Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions http-body/src/size_hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///
/// * 0 for `lower`
/// * `None` for `upper`.
#[derive(Debug, Default, Clone)]
#[derive(Debug, Default, Clone, Copy)]
pub struct SizeHint {
lower: u64,
upper: Option<u64>,
Expand Down Expand Up @@ -178,7 +178,7 @@ fn size_hint_addition_basic() {
let exact_l = SizeHint::with_exact(20);
let exact_r = SizeHint::with_exact(5);

assert_eq!(Some(25), (exact_l.clone() + exact_r).exact());
assert_eq!(Some(25), (exact_l + exact_r).exact());

let inexact_l = SizeHint {
lower: 25,
Expand All @@ -189,12 +189,12 @@ fn size_hint_addition_basic() {
upper: Some(50),
};

let inexact = inexact_l + inexact_r.clone();
let inexact = inexact_l + inexact_r;

assert_eq!(inexact.lower(), 35);
assert_eq!(inexact.upper(), None);

let exact_inexact = exact_l.clone() + inexact_r.clone();
let exact_inexact = exact_l + inexact_r;

assert_eq!(exact_inexact.lower(), 30);
assert_eq!(exact_inexact.upper(), Some(70));
Expand Down
2 changes: 1 addition & 1 deletion http-body/tests/is_end_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl Body for Mock {
}

fn size_hint(&self) -> SizeHint {
self.size_hint.clone()
self.size_hint
}
}

Expand Down