Skip to content

Commit 22cf6a6

Browse files
zyfjeffimeoer
authored andcommitted
fix cargo clippy warnning
Signed-off-by: tianqian.zyf <tianqian.zyf@alibaba-inc.com>
1 parent 984dd82 commit 22cf6a6

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/api/filesystem/overlay.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ pub(crate) fn is_chardev(st: stat64) -> bool {
195195
pub(crate) fn is_whiteout(st: stat64) -> bool {
196196
// A whiteout is created as a character device with 0/0 device number.
197197
// See ref: https://docs.kernel.org/filesystems/overlayfs.html#whiteouts-and-opaque-directories
198-
let major = unsafe { libc::major(st.st_rdev) };
199-
let minor = unsafe { libc::minor(st.st_rdev) };
198+
let major = libc::major(st.st_rdev);
199+
let minor = libc::minor(st.st_rdev);
200200
is_chardev(st) && major == 0 && minor == 0
201201
}
202202

src/api/vfs/sync_io.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,7 @@ impl FileSystem for Vfs {
306306
}
307307
match self.get_real_rootfs(inode)? {
308308
(Left(fs), idata) => fs.open(ctx, idata.ino(), flags, fuse_flags),
309-
(Right(fs), idata) => fs
310-
.open(ctx, idata.ino(), flags, fuse_flags)
311-
.map(|(h, opt, passthrough)| (h.map(Into::into), opt, passthrough)),
309+
(Right(fs), idata) => fs.open(ctx, idata.ino(), flags, fuse_flags),
312310
}
313311
}
314312

@@ -522,9 +520,7 @@ impl FileSystem for Vfs {
522520
}
523521
match self.get_real_rootfs(inode)? {
524522
(Left(fs), idata) => fs.opendir(ctx, idata.ino(), flags),
525-
(Right(fs), idata) => fs
526-
.opendir(ctx, idata.ino(), flags)
527-
.map(|(h, opt)| (h.map(Into::into), opt)),
523+
(Right(fs), idata) => fs.opendir(ctx, idata.ino(), flags),
528524
}
529525
}
530526

src/transport/fusedev/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl<'a, S: BitmapSlice> FuseDevWriter<'a, S> {
265265
}
266266

267267
fn check_available_space(&self, sz: usize) -> io::Result<()> {
268-
assert!(self.buffered || self.buf.len() == 0);
268+
assert!(self.buffered || self.buf.is_empty());
269269
if sz > self.available_bytes() {
270270
Err(io::Error::new(
271271
io::ErrorKind::InvalidData,

0 commit comments

Comments
 (0)