5
0
mirror of git://git.proxmox.com/git/proxmox-fuse.git synced 2024-12-21 13:34:41 +03:00

clippy fixes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-05-07 10:57:08 +02:00
parent 238e315c11
commit cdf306f9d2
4 changed files with 5 additions and 12 deletions

View File

@ -55,7 +55,7 @@ fn to_entry_param(stat: &libc::stat) -> EntryParam {
EntryParam {
inode: stat.st_ino,
generation: 1,
attr: stat.clone(),
attr: *stat,
attr_timeout: std::f64::MAX,
entry_timeout: std::f64::MAX,
}

View File

@ -360,7 +360,7 @@ impl ReaddirPlus {
let entry = sys::EntryParam {
inode: stat.st_ino,
generation,
attr: stat.clone(),
attr: *stat,
attr_timeout,
entry_timeout,
};

View File

@ -251,7 +251,6 @@ impl FuseData {
&*file_info,
)
};
let size = usize::from(size);
let offset = offset as u64;
fuse_data
.pending_requests
@ -301,7 +300,7 @@ impl FuseData {
request: RequestGuard::from_raw(request),
inode,
to_set,
stat: Stat::from(stat.clone()),
stat: Stat::from(*stat),
fh: file_info.map(|fi| fi.fh),
}));
}
@ -348,7 +347,6 @@ impl FuseData {
&*file_info,
)
};
let size = usize::from(size);
let offset = offset as u64;
fuse_data
.pending_requests
@ -366,7 +364,6 @@ impl FuseData {
extern "C" fn listxattr(request: sys::Request, inode: u64, size: libc::size_t) {
let fuse_data = unsafe { &*(sys::fuse_req_userdata(request) as *mut FuseData) };
let size = usize::from(size);
fuse_data.pending_requests.borrow_mut().push_back({
if size == 0 {
Request::ListXAttrSize(requests::ListXAttrSize {
@ -392,7 +389,6 @@ impl FuseData {
let fuse_data = unsafe { &*(sys::fuse_req_userdata(request) as *mut FuseData) };
let attr_name = unsafe { CStr::from_ptr(attr_name) };
let attr_name = OsStr::from_bytes(attr_name.to_bytes()).to_owned();
let size = usize::from(size);
fuse_data.pending_requests.borrow_mut().push_back({
if size == 0 {
Request::GetXAttrSize(requests::GetXAttrSize {

View File

@ -266,11 +266,8 @@ pub enum ReplyBufState {
impl ReplyBufState {
#[inline]
pub fn is_full(self) -> bool {
match self {
ReplyBufState::Full => true,
_ => false,
}
pub fn is_full(&self) -> bool {
matches!(self, &ReplyBufState::Full)
}
}