Skip to content

Commit d7f672f

Browse files
committed
Fix clippy warnings from macOS port
Signed-off-by: Cong Wang <cwang@multikernel.io>
1 parent 7466323 commit d7f672f

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

src/fs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,11 +1873,11 @@ impl Filesystem for BranchFs {
18731873
match nix::sys::statvfs::statvfs(storage_path) {
18741874
Ok(stat) => {
18751875
reply.statfs(
1876-
stat.blocks().into(),
1877-
stat.blocks_free().into(),
1878-
stat.blocks_available().into(),
1879-
stat.files().into(),
1880-
stat.files_free().into(),
1876+
stat.blocks(),
1877+
stat.blocks_free(),
1878+
stat.blocks_available(),
1879+
stat.files(),
1880+
stat.files_free(),
18811881
stat.block_size() as u32,
18821882
stat.name_max() as u32,
18831883
stat.fragment_size() as u32,

src/platform/linux.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,21 @@ pub struct PassthroughState {
6161
pub backing_ids: HashMap<u64, BackingId>,
6262
}
6363

64-
impl PassthroughState {
65-
pub fn new() -> Self {
64+
impl Default for PassthroughState {
65+
fn default() -> Self {
6666
Self {
6767
next_fh: AtomicU64::new(1),
6868
backing_ids: HashMap::new(),
6969
}
7070
}
7171
}
7272

73+
impl PassthroughState {
74+
pub fn new() -> Self {
75+
Self::default()
76+
}
77+
}
78+
7379
pub fn try_open_passthrough(state: &mut PassthroughState, file: File, reply: ReplyOpen) {
7480
let backing_id = match reply.open_backing(&file) {
7581
Ok(id) => id,

src/platform/macos.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ pub fn ctl_file_size(_ino: u64) -> u64 {
4646

4747
pub struct PassthroughState {}
4848

49+
impl Default for PassthroughState {
50+
fn default() -> Self {
51+
Self {}
52+
}
53+
}
54+
4955
impl PassthroughState {
5056
pub fn new() -> Self {
51-
Self {}
57+
Self::default()
5258
}
5359
}
5460

0 commit comments

Comments
 (0)