Skip to content

Commit 50131dd

Browse files
ZizhengBianeryugey
authored andcommitted
api: fix cargo clippy errors
Cargo clippy wants to let us add `Default` implementation for PseudoFs, just do it. error: you should consider adding a `Default` implementation for `PseudoFs` --> src/api/pseudo_fs.rs:80:5 | 80 | / pub fn new() -> Self { 81 | | let root_inode = Arc::new(PseudoInode::new(ROOT_ID, ROOT_ID, String::from("/"))); 82 | | let fs = PseudoFs { 83 | | next_inode: AtomicU64::new(PSEUDOFS_NEXT_INODE), ... | 94 | | fs 95 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default = note: `-D clippy::new-without-default` implied by `-D warnings` Signed-off-by: Zizheng Bian <[email protected]>
1 parent 9852b9e commit 50131dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/api/pseudo_fs.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,12 @@ impl PseudoFs {
329329
}
330330
}
331331

332+
impl Default for PseudoFs {
333+
fn default() -> Self {
334+
Self::new()
335+
}
336+
}
337+
332338
impl FileSystem for PseudoFs {
333339
type Inode = Inode;
334340
type Handle = Handle;

0 commit comments

Comments
 (0)