Skip to content

Commit 8c850fa

Browse files
committed
api: impl Default for Entry structure
So that crates that depend on Entry could just use ..Default::default() to initialize new fields in Entry that they don't care. Signed-off-by: Eryu Guan <[email protected]>
1 parent 2c99659 commit 8c850fa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/api/filesystem/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ impl From<Entry> for fuse::EntryOut {
7878
}
7979
}
8080

81+
impl Default for Entry {
82+
fn default() -> Self {
83+
Entry {
84+
inode: 0,
85+
generation: 0,
86+
attr: unsafe { std::mem::zeroed() },
87+
attr_flags: 0,
88+
attr_timeout: Duration::default(),
89+
entry_timeout: Duration::default(),
90+
}
91+
}
92+
}
93+
8194
/// Represents information about an entry in a directory.
8295
#[derive(Copy, Clone)]
8396
pub struct DirEntry<'a> {

0 commit comments

Comments
 (0)