Skip to content

Commit fc76d66

Browse files
committed
feat(store): add Bincode error variant to FileError enum
1 parent 3998788 commit fc76d66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/file_store/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pub enum FileError {
1818
Io(io::Error),
1919
/// Magic bytes do not match what is expected.
2020
InvalidMagicBytes { got: Vec<u8>, expected: Vec<u8> },
21+
/// Failure to decode data from the file.
22+
Bincode(bincode::ErrorKind),
2123
}
2224

2325
impl core::fmt::Display for FileError {
@@ -29,6 +31,7 @@ impl core::fmt::Display for FileError {
2931
"file has invalid magic bytes: expected={:?} got={:?}",
3032
expected, got,
3133
),
34+
Self::Bincode(e) => write!(f, "bincode error while reading entry {}", e),
3235
}
3336
}
3437
}

0 commit comments

Comments
 (0)