diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-28 10:11:20 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:13 +0300 |
commit | 800ccc2149d018d5e29c25e89265c563885f32d0 (patch) | |
tree | d3ffd9a88de7d7932ecfa5162a5c54c59d91e9b6 /buffered-reader | |
parent | 18ab269a0e6967d78df8527679f2479c39650250 (diff) |
Allow ::new to not return Self
It is Rust custom that the new method for a type returns an instance
of that type. However, sometimes that's not wanted. Tell clippy that
these cases are OK. I opted to not do this globally, because that
would prevent clippy from catching future cases.
Found by clippy warning new_ret_no_self:
https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self
Diffstat (limited to 'buffered-reader')
-rw-r--r-- | buffered-reader/src/file_error.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/buffered-reader/src/file_error.rs b/buffered-reader/src/file_error.rs index eba444cd..add00e6b 100644 --- a/buffered-reader/src/file_error.rs +++ b/buffered-reader/src/file_error.rs @@ -12,6 +12,7 @@ pub(crate) struct FileError { source: io::Error, } +#[allow(clippy::new_ret_no_self)] impl FileError { /// Returns a new `io::Error` backed by a `FileError`. pub fn new<P: AsRef<Path>>(path: P, source: io::Error) -> io::Error { |