perf(body): reduce memory size of Body by a u64 (#2118)

Replaces the `Option<u64>` content-length with a `DecodedLength`, which
stores its unknown-ness as `u64::MAX`.
This commit is contained in:
Sean McArthur
2020-01-27 13:09:40 -08:00
committed by GitHub
parent 1881db6391
commit a354580e3f
6 changed files with 96 additions and 20 deletions

View File

@@ -239,7 +239,7 @@ where
let mut body = match body_len {
DecodedLength::ZERO => Body::empty(),
other => {
let (tx, rx) = Body::new_channel(other.into_opt());
let (tx, rx) = Body::new_channel(other);
self.body_tx = Some(tx);
rx
}