From 997155ef2cfed3a3dca8897dd97c75001f7519b4 Mon Sep 17 00:00:00 2001 From: auronandace Date: Wed, 17 Jun 2026 10:41:06 +0100 Subject: [PATCH 1/2] tackle some minor clippy lints in ptyd and its dependencies --- daemon/src/lib.rs | 2 ++ ptyd/src/controlterm.rs | 2 +- ptyd/src/main.rs | 2 +- scheme-utils/src/blocking.rs | 2 +- scheme-utils/src/readiness_based.rs | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index 791a6966eb..cd7a09c703 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -43,6 +43,7 @@ pub struct Daemon { impl Daemon { /// Create a new daemon. + #[expect(clippy::new_ret_no_self)] pub fn new(f: impl FnOnce(Daemon) -> !) -> ! { let write_pipe = unsafe { io::PipeWriter::from_raw_fd(get_fd("INIT_NOTIFY")) }; @@ -89,6 +90,7 @@ pub struct SchemeDaemon { impl SchemeDaemon { /// Create a new daemon for use with schemes. + #[expect(clippy::new_ret_no_self)] pub fn new(f: impl FnOnce(SchemeDaemon) -> !) -> ! { let write_pipe = unsafe { io::PipeWriter::from_raw_fd(get_fd("INIT_NOTIFY")) }; diff --git a/ptyd/src/controlterm.rs b/ptyd/src/controlterm.rs index ae8011c905..95b09536a8 100644 --- a/ptyd/src/controlterm.rs +++ b/ptyd/src/controlterm.rs @@ -38,7 +38,7 @@ impl Resource for PtyControlTerm { fn path(&mut self, buf: &mut [u8]) -> Result { FpathWriter::with(buf, "pty", |w| { - write!(w, "{}", "ptmx").unwrap(); + write!(w, "ptmx").unwrap(); Ok(()) }) } diff --git a/ptyd/src/main.rs b/ptyd/src/main.rs index 6eec7ea161..b0fed5676a 100644 --- a/ptyd/src/main.rs +++ b/ptyd/src/main.rs @@ -75,7 +75,7 @@ fn daemon(daemon: daemon::Daemon) -> ! { timeout_count = timeout_count.wrapping_add(1); - for (_id, handle) in scheme.handles.iter_mut() { + for handle in scheme.handles.values_mut() { if let Handle::Resource(res) = handle { res.timeout(timeout_count); } diff --git a/scheme-utils/src/blocking.rs b/scheme-utils/src/blocking.rs index 6c5c3dc833..86aca7b002 100644 --- a/scheme-utils/src/blocking.rs +++ b/scheme-utils/src/blocking.rs @@ -87,7 +87,7 @@ impl<'sock> Blocking<'sock> { }) => { panic!("scheme response writing should always block"); } - Err(err) => return Err(LError::from(err).into()), + Err(err) => Err(LError::from(err).into()), } } diff --git a/scheme-utils/src/readiness_based.rs b/scheme-utils/src/readiness_based.rs index 0eb929d333..11cece351f 100644 --- a/scheme-utils/src/readiness_based.rs +++ b/scheme-utils/src/readiness_based.rs @@ -190,7 +190,7 @@ impl<'sock> ReadinessBased<'sock> { }) => { panic!("scheme response writing should always block"); } - Err(err) => return Err(LError::from(err).into()), + Err(err) => Err(LError::from(err).into()), } } } From e957042c45f05bc4562f435de835b7c38afd3b5e Mon Sep 17 00:00:00 2001 From: Mathew John Roberts Date: Wed, 17 Jun 2026 12:46:36 +0100 Subject: [PATCH 2/2] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Wildan Mubarok --- daemon/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index cd7a09c703..74fef679b5 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -43,8 +43,7 @@ pub struct Daemon { impl Daemon { /// Create a new daemon. - #[expect(clippy::new_ret_no_self)] - pub fn new(f: impl FnOnce(Daemon) -> !) -> ! { + pub fn new(f: impl FnOnce(Self) -> !) -> ! { let write_pipe = unsafe { io::PipeWriter::from_raw_fd(get_fd("INIT_NOTIFY")) }; f(Daemon { write_pipe })