Skip to content

Commit

Permalink
Fix clippy::unnecessary_cast warning
Browse files Browse the repository at this point in the history
```
warning: casting to the same type is unnecessary (`u64` -> `u64`)
   --> src/lib.rs:398:33
    |
398 |         Poll::Ready(res.map(|p| p as u64))
    |                                 ^^^^^^^^ help: try: `p`
    |
    = 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 (`u64` -> `u64`)
   --> src/lib.rs:421:33
    |
421 |         Poll::Ready(res.map(|p| p as u64))
    |                                 ^^^^^^^^ help: try: `p`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
```
  • Loading branch information
taiki-e committed Dec 16, 2022
1 parent d1f092e commit 1a1f8b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ impl<T: tokio::io::AsyncSeek> futures_io::AsyncSeek for Compat<T> {
}
let res = ready!(self.as_mut().project().inner.poll_complete(cx));
*self.as_mut().project().seek_pos = None;
Poll::Ready(res.map(|p| p as u64))
Poll::Ready(res)
}
}

Expand All @@ -418,7 +418,7 @@ impl<T: futures_io::AsyncSeek> tokio::io::AsyncSeek for Compat<T> {
};
let res = ready!(self.as_mut().project().inner.poll_seek(cx, pos));
*self.as_mut().project().seek_pos = None;
Poll::Ready(res.map(|p| p as u64))
Poll::Ready(res)
}
}

Expand Down

0 comments on commit 1a1f8b8

Please sign in to comment.