[pbs-devel] [PATCH proxmox 15/19] apt: ignore clippy lint about new having to return `Self`

Shannon Sterz s.sterz at proxmox.com
Thu Mar 6 13:43:45 CET 2025


while this is a reasonable convention to follow, in this case the new
function is part of a public trait and changing the signature would
force all users to adapt. so ignore the lint for now [1].

[1]:
https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 proxmox-apt/src/repositories/file.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/proxmox-apt/src/repositories/file.rs b/proxmox-apt/src/repositories/file.rs
index e34e84e0..9f4beafd 100644
--- a/proxmox-apt/src/repositories/file.rs
+++ b/proxmox-apt/src/repositories/file.rs
@@ -30,6 +30,7 @@ pub trait APTRepositoryFileImpl {
     /// If the file is hidden, the path points to a directory, or the extension
     /// is usually ignored by APT (e.g. `.orig`), `Ok(None)` is returned, while
     /// invalid file names yield an error.
+    #[allow(clippy::new_ret_no_self)]
     fn new<P: AsRef<Path>>(path: P) -> Result<Option<APTRepositoryFile>, APTRepositoryFileError>;
 
     fn with_content(content: String, content_type: APTRepositoryFileType) -> Self;
-- 
2.39.5





More information about the pbs-devel mailing list