Skip to content

Commit

Permalink
remove all transparent errors with from impl
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Oct 17, 2024
1 parent 6d402ed commit fa139b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
23 changes: 4 additions & 19 deletions crates/core/src/archiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,15 @@ pub enum ArchiverErrorKind {
/// option should contain a value, but contained `None`
UnpackingTreeTypeOptionalFailed,
/// couldn't get size for archive: `{0:?}`
CouldNotGetSizeForArchive(#[from] BackendAccessErrorKind),
CouldNotGetSizeForArchive(BackendAccessErrorKind),
/// couldn't determine size for item in Archiver
CouldNotDetermineSize,
/// failed to save index: `{0:?}`
IndexSavingFailed(#[from] IndexErrorKind),
IndexSavingFailed(IndexErrorKind),
/// failed to save file in backend: `{0:?}`
FailedToSaveFileInBackend(#[from] CryptBackendErrorKind),
FailedToSaveFileInBackend(CryptBackendErrorKind),
/// finalizing SnapshotSummary failed: `{0:?}`
FinalizingSnapshotSummaryFailed(#[from] SnapshotFileErrorKind),
/// [`PackerErrorKind`]
#[error(transparent)]
FromPacker(#[from] PackerErrorKind),
/// [`TreeErrorKind`]
#[error(transparent)]
FromTree(#[from] TreeErrorKind),
/// [`ConfigFileErrorKind`]
#[error(transparent)]
FromConfigFile(#[from] ConfigFileErrorKind),
/// [`std::io::Error`]
#[error(transparent)]
FromStdIo(#[from] std::io::Error),
/// [`StripPrefixError`]
#[error(transparent)]
FromStripPrefix(#[from] StripPrefixError),
FinalizingSnapshotSummaryFailed(SnapshotFileErrorKind),
/// conversion from `u64` to `usize` failed: `{0:?}`
ConversionFromU64ToUsizeFailed(TryFromIntError),
}
Expand Down
5 changes: 2 additions & 3 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ pub enum RusticErrorKind {
/// Describes the errors that can be returned by the various backends from the `rustic_backend` crate.
#[error(transparent)]
Backend(#[from] anyhow::Error),
/// [`std::io::Error`]
#[error(transparent)]
FromIo(#[from] std::io::Error),
/// IO error
Io,
}

pub mod immut_str {
Expand Down

0 comments on commit fa139b6

Please sign in to comment.