Merge branch 'base-minor-clippy-cleanup' into 'main'
tackle some minor clippy lints in ptyd and its dependencies See merge request redox-os/base!281
This commit is contained in:
+2
-1
@@ -43,7 +43,7 @@ pub struct Daemon {
|
||||
|
||||
impl Daemon {
|
||||
/// Create a new daemon.
|
||||
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 })
|
||||
@@ -89,6 +89,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")) };
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ impl Resource for PtyControlTerm {
|
||||
|
||||
fn path(&mut self, buf: &mut [u8]) -> Result<usize> {
|
||||
FpathWriter::with(buf, "pty", |w| {
|
||||
write!(w, "{}", "ptmx").unwrap();
|
||||
write!(w, "ptmx").unwrap();
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user