From 800ccc2149d018d5e29c25e89265c563885f32d0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 28 Sep 2021 10:11:20 +0300 Subject: 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 --- buffered-reader/src/file_error.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'buffered-reader') 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>(path: P, source: io::Error) -> io::Error { -- cgit v1.2.3