diff options
Diffstat (limited to 'asyncgit/src/error.rs')
-rw-r--r-- | asyncgit/src/error.rs | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/asyncgit/src/error.rs b/asyncgit/src/error.rs index 80c490fe..d6e00d76 100644 --- a/asyncgit/src/error.rs +++ b/asyncgit/src/error.rs @@ -5,56 +5,56 @@ use thiserror::Error; #[derive(Error, Debug)] pub enum Error { - #[error("`{0}`")] - Generic(String), + #[error("`{0}`")] + Generic(String), - #[error("git: no head found")] - NoHead, + #[error("git: no head found")] + NoHead, - #[error("git: remote url not found")] - UnknownRemote, + #[error("git: remote url not found")] + UnknownRemote, - #[error("git: inconclusive remotes")] - NoDefaultRemoteFound, + #[error("git: inconclusive remotes")] + NoDefaultRemoteFound, - #[error("git: work dir error")] - NoWorkDir, + #[error("git: work dir error")] + NoWorkDir, - #[error("git: uncommitted changes")] - UncommittedChanges, + #[error("git: uncommitted changes")] + UncommittedChanges, - #[error("git: can\u{2019}t run blame on a binary file")] - NoBlameOnBinaryFile, + #[error("git: can\u{2019}t run blame on a binary file")] + NoBlameOnBinaryFile, - #[error("binary file")] - BinaryFile, + #[error("binary file")] + BinaryFile, - #[error("io error:{0}")] - Io(#[from] std::io::Error), + #[error("io error:{0}")] + Io(#[from] std::io::Error), - #[error("git error:{0}")] - Git(#[from] git2::Error), + #[error("git error:{0}")] + Git(#[from] git2::Error), - #[error("utf8 error:{0}")] - Utf8Conversion(#[from] FromUtf8Error), + #[error("utf8 error:{0}")] + Utf8Conversion(#[from] FromUtf8Error), - #[error("TryFromInt error:{0}")] - IntConversion(#[from] TryFromIntError), + #[error("TryFromInt error:{0}")] + IntConversion(#[from] TryFromIntError), - #[error("EasyCast error:{0}")] - EasyCast(#[from] easy_cast::Error), + #[error("EasyCast error:{0}")] + EasyCast(#[from] easy_cast::Error), } pub type Result<T> = std::result::Result<T, Error>; impl<T> From<std::sync::PoisonError<T>> for Error { - fn from(error: std::sync::PoisonError<T>) -> Self { - Self::Generic(format!("poison error: {}", error)) - } + fn from(error: std::sync::PoisonError<T>) -> Self { + Self::Generic(format!("poison error: {}", error)) + } } impl<T> From<crossbeam_channel::SendError<T>> for Error { - fn from(error: crossbeam_channel::SendError<T>) -> Self { - Self::Generic(format!("send error: {}", error)) - } + fn from(error: crossbeam_channel::SendError<T>) -> Self { + Self::Generic(format!("send error: {}", error)) + } } |