Move Response::unit and stream to the heap

This commit is contained in:
Martin Algesten
2021-03-24 21:01:42 +01:00
parent cfaca317c6
commit 7c6ed53df3
3 changed files with 26 additions and 8 deletions

View File

@@ -416,4 +416,12 @@ mod tests {
let _error: Box<dyn Send> = Box::new(Error::new(ErrorKind::Io, None));
let _error: Box<dyn Sync> = Box::new(Error::new(ErrorKind::Io, None));
}
#[test]
fn ensure_error_size() {
// This is platform dependent, so we can't be too strict or precise.
let size = std::mem::size_of::<Error>();
println!("Error size: {}", size);
assert!(size < 500); // 344 on Macbook M1
}
}