diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-07 18:45:55 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-09 13:13:59 +0200 |
commit | 76f2e0ed8e30a0d1cde749f3444bd8a4c81bea87 (patch) | |
tree | 0085cfecde9d35b15c98fc8650734ecf5d61358f /buffered-reader/src/generic.rs | |
parent | baecfecbf953aa9e40f16084b927f35b69efc8f0 (diff) |
Lint: Remove redundant returns.
- https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
Diffstat (limited to 'buffered-reader/src/generic.rs')
-rw-r--r-- | buffered-reader/src/generic.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/buffered-reader/src/generic.rs b/buffered-reader/src/generic.rs index 8d6ec104..19f799eb 100644 --- a/buffered-reader/src/generic.rs +++ b/buffered-reader/src/generic.rs @@ -213,7 +213,7 @@ impl<T: io::Read + Send + Sync, C: fmt::Debug + Sync + Send> Generic<T, C> { impl<T: io::Read + Send + Sync, C: fmt::Debug + Sync + Send> io::Read for Generic<T, C> { fn read(&mut self, buf: &mut [u8]) -> Result<usize, io::Error> { - return buffered_reader_generic_read_impl(self, buf); + buffered_reader_generic_read_impl(self, buf) } } @@ -227,11 +227,11 @@ impl<T: io::Read + Send + Sync, C: fmt::Debug + Sync + Send> BufferedReader<C> f } fn data(&mut self, amount: usize) -> Result<&[u8], io::Error> { - return self.data_helper(amount, false, false); + self.data_helper(amount, false, false) } fn data_hard(&mut self, amount: usize) -> Result<&[u8], io::Error> { - return self.data_helper(amount, true, false); + self.data_helper(amount, true, false) } // Note: @@ -257,16 +257,16 @@ impl<T: io::Read + Send + Sync, C: fmt::Debug + Sync + Send> BufferedReader<C> f return &self.buffer.as_ref().unwrap()[self.cursor - amount..]; } else { assert_eq!(amount, 0); - return &b""[..]; + &b""[..] } } fn data_consume(&mut self, amount: usize) -> Result<&[u8], io::Error> { - return self.data_helper(amount, false, true); + self.data_helper(amount, false, true) } fn data_consume_hard(&mut self, amount: usize) -> Result<&[u8], io::Error> { - return self.data_helper(amount, true, true); + self.data_helper(amount, true, true) } fn get_mut(&mut self) -> Option<&mut dyn BufferedReader<C>> { |