sys: clippy fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-06-29 09:50:51 +02:00
parent 8f769a3996
commit b1a5daef61
2 changed files with 6 additions and 19 deletions

View File

@ -15,7 +15,7 @@ nix::ioctl_read!(fs_ioc_fsgetxattr, b'X', 31, FSXAttr);
nix::ioctl_write_ptr!(fs_ioc_fssetxattr, b'X', 32, FSXAttr);
#[repr(C)]
#[derive(Debug)]
#[derive(Debug, Default)]
/// Rust bindings for struct fsxattr (fsgetxattr, fssetxattr)
pub struct FSXAttr {
pub fsx_xflags: u32,
@ -25,16 +25,3 @@ pub struct FSXAttr {
pub fsx_cowextsize: u32,
pub fsx_pad: [u8; 8],
}
impl Default for FSXAttr {
fn default() -> Self {
FSXAttr {
fsx_xflags: 0u32,
fsx_extsize: 0u32,
fsx_nextents: 0u32,
fsx_projid: 0u32,
fsx_cowextsize: 0u32,
fsx_pad: [0u8; 8],
}
}
}

View File

@ -34,23 +34,23 @@ pub trait WorkerTaskContext: Send + Sync {
/// Convenience implementation:
impl<T: WorkerTaskContext + ?Sized> WorkerTaskContext for std::sync::Arc<T> {
fn abort_requested(&self) -> bool {
<T as WorkerTaskContext>::abort_requested(&*self)
<T as WorkerTaskContext>::abort_requested(self)
}
fn check_abort(&self) -> Result<(), Error> {
<T as WorkerTaskContext>::check_abort(&*self)
<T as WorkerTaskContext>::check_abort(self)
}
fn shutdown_requested(&self) -> bool {
<T as WorkerTaskContext>::shutdown_requested(&*self)
<T as WorkerTaskContext>::shutdown_requested(self)
}
fn fail_on_shutdown(&self) -> Result<(), Error> {
<T as WorkerTaskContext>::fail_on_shutdown(&*self)
<T as WorkerTaskContext>::fail_on_shutdown(self)
}
fn log(&self, level: log::Level, message: &std::fmt::Arguments) {
<T as WorkerTaskContext>::log(&*self, level, message)
<T as WorkerTaskContext>::log(self, level, message)
}
}