diff options
author | Alexander Batischev <eual.jp@gmail.com> | 2021-07-21 22:01:30 +0300 |
---|---|---|
committer | Alexander Batischev <eual.jp@gmail.com> | 2021-07-21 22:25:50 +0300 |
commit | 969ec42e788bf0eb8be8319b3779da00a8bf1c9a (patch) | |
tree | 4330810a2b142e9be7bf1c51b12d43e030f5d572 /src | |
parent | b8a242aeb81ec5c0a1d41c7566ec9ec9eea2a020 (diff) | |
download | obnam2-969ec42e788bf0eb8be8319b3779da00a8bf1c9a.tar.gz |
Replace FsEntryResult with plain Result
Diffstat (limited to 'src')
-rw-r--r-- | src/fsentry.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fsentry.rs b/src/fsentry.rs index 3f532cc..1a30d41 100644 --- a/src/fsentry.rs +++ b/src/fsentry.rs @@ -56,11 +56,9 @@ pub enum FsEntryError { ReadLink(PathBuf, std::io::Error), } -pub type FsEntryResult<T> = Result<T, FsEntryError>; - #[allow(clippy::len_without_is_empty)] impl FilesystemEntry { - pub fn from_metadata(path: &Path, meta: &Metadata) -> FsEntryResult<Self> { + pub fn from_metadata(path: &Path, meta: &Metadata) -> Result<Self, FsEntryError> { let kind = FilesystemKind::from_file_type(meta.file_type()); let symlink_target = if kind == FilesystemKind::Symlink { debug!("reading symlink target for {:?}", path); @@ -184,7 +182,7 @@ impl FilesystemKind { } } - pub fn from_code(code: u8) -> FsEntryResult<Self> { + pub fn from_code(code: u8) -> Result<Self, FsEntryError> { match code { 0 => Ok(FilesystemKind::Regular), 1 => Ok(FilesystemKind::Directory), |