Skip to content

Commit baa6f30

Browse files
committed
Fix clippy::unnecessary_cast warning
``` warning: casting to the same type is unnecessary (`usize` -> `usize`) --> futures-util/src/stream/stream/take.rs:57:37 | 57 | let lower = cmp::min(lower, self.remaining as usize); | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.remaining` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast = note: `#[warn(clippy::unnecessary_cast)]` on by default warning: casting to the same type is unnecessary (`usize` -> `usize`) --> futures-util/src/stream/stream/take.rs:60:28 | 60 | Some(x) if x < self.remaining as usize => Some(x), | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.remaining` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting to the same type is unnecessary (`usize` -> `usize`) --> futures-util/src/stream/stream/take.rs:61:23 | 61 | _ => Some(self.remaining as usize), | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.remaining` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast ```
1 parent c9af271 commit baa6f30

File tree

1 file changed

+3
-3
lines changed
  • futures-util/src/stream/stream

1 file changed

+3
-3
lines changed

futures-util/src/stream/stream/take.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ where
5454

5555
let (lower, upper) = self.stream.size_hint();
5656

57-
let lower = cmp::min(lower, self.remaining as usize);
57+
let lower = cmp::min(lower, self.remaining);
5858

5959
let upper = match upper {
60-
Some(x) if x < self.remaining as usize => Some(x),
61-
_ => Some(self.remaining as usize),
60+
Some(x) if x < self.remaining => Some(x),
61+
_ => Some(self.remaining),
6262
};
6363

6464
(lower, upper)

0 commit comments

Comments
 (0)