diff options
| author | Botahamec <botahamec@outlook.com> | 2022-10-23 12:57:03 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2022-10-23 12:57:03 -0400 |
| commit | 6fae1af77dbfc80b986427ad5a06d96565702c38 (patch) | |
| tree | 9c22b59255cd701c3f9f853afb06403e1ad9595b /src/result.rs | |
| parent | f52dc60a3c83d43be2b9df0e4a6e4fa0d704a7b3 (diff) | |
Rename UnexpectedError
Diffstat (limited to 'src/result.rs')
| -rw-r--r-- | src/result.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/result.rs b/src/result.rs index 03483d2..9f1bb89 100644 --- a/src/result.rs +++ b/src/result.rs @@ -1,7 +1,7 @@ #[cfg(feature = "std")] use std::error::Error; -use crate::{unexpected::Errorable, UnexpectedError}; +use crate::{unexpected::Errorable, RawUnexpected}; mod sealed { pub trait Sealed {} @@ -12,29 +12,29 @@ use sealed::Sealed; #[cfg(feature = "std")] pub trait ResultErrorExt<T>: Sealed { - /// Converts `Result<T, E>` to `Result<T, UnexpectedError>`. + /// Converts `Result<T, E>` to `Result<T, RawUnexpected>`. #[allow(clippy::missing_errors_doc)] - fn unexpect(self) -> Result<T, UnexpectedError>; + fn unexpect(self) -> Result<T, RawUnexpected>; } #[cfg(feature = "std")] impl<T, E: Error + Send + Sync + 'static> ResultErrorExt<T> for Result<T, E> { - fn unexpect(self) -> Result<T, UnexpectedError> { - self.map_err(UnexpectedError::new) + fn unexpect(self) -> Result<T, RawUnexpected> { + self.map_err(RawUnexpected::new) } } pub trait ResultMsgExt<T>: Sealed { - /// Converts `Result<T, E>` to `Result<T, UnexpectedError>`. + /// Converts `Result<T, E>` to `Result<T, RawUnExpected>`. /// /// This is provided for compatibility with `no_std`. If your type /// implements [`Error`], then you should prefer that instead. #[allow(clippy::missing_errors_doc)] - fn unexpect_msg(self) -> Result<T, UnexpectedError>; + fn unexpect_msg(self) -> Result<T, RawUnexpected>; } impl<T, E: Errorable + 'static> ResultMsgExt<T> for Result<T, E> { - fn unexpect_msg(self) -> Result<T, UnexpectedError> { - self.map_err(UnexpectedError::msg) + fn unexpect_msg(self) -> Result<T, RawUnexpected> { + self.map_err(RawUnexpected::msg) } } |
