diff options
| author | Botahamec <botahamec@outlook.com> | 2022-10-23 16:42:44 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2022-10-23 16:42:44 -0400 |
| commit | fee373821f0e38da00c405f55d68242c64689629 (patch) | |
| tree | 2e2037287971097df75e80fcbc7a026df40a5c34 /src | |
| parent | 917b4c45fd76319a48c25b00187040f3d189bb35 (diff) | |
Better docs
Diffstat (limited to 'src')
| -rw-r--r-- | src/exun.rs | 10 | ||||
| -rw-r--r-- | src/lib.rs | 1 | ||||
| -rw-r--r-- | src/result.rs | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/exun.rs b/src/exun.rs index 7f6376e..138ff4f 100644 --- a/src/exun.rs +++ b/src/exun.rs @@ -71,7 +71,7 @@ impl<E> From<RawUnexpected> for Exun<E, UnexpectedError> { } impl<E, U> Exun<E, U> { - /// Converts from `Expect<E, U>` to [`Option<E>`]. + /// Converts from `Exun<E, U>` to [`Option<E>`]. /// /// Converts `self` into an [`Option<E>`], consuming `self`, and discarding /// the unexpected value, if any. @@ -95,7 +95,7 @@ impl<E, U> Exun<E, U> { } } - /// Converts from `Expect<E, U>` to [`Option<U>`]. + /// Converts from `Exun<E, U>` to [`Option<U>`]. /// /// Converts `self` into an [`Option<U>`], consuming `self`, and discarding /// the expected value, if any. @@ -121,7 +121,7 @@ impl<E, U> Exun<E, U> { } } - /// Converts from `&mut Expect<E, U>` to `Expect<&mut E, &mut U>`. + /// Converts from `&mut Exun<E, U>` to `Exun<&mut E, &mut U>`. /// /// # Examples /// @@ -152,7 +152,7 @@ impl<E, U> Exun<E, U> { } } - /// Maps a `Expect<E, U>` to `Expect<T, U>` by applying a function to a + /// Maps a `Exun<E, U>` to `Exun<T, U>` by applying a function to a /// contained [`Expected`] value, leaving an [`Unexpected`] value /// untouched. /// @@ -178,7 +178,7 @@ impl<E, U> Exun<E, U> { } } - /// Maps a `Expect<E, U>` to `Expect<E, T>` by applying a function to a + /// Maps a `Exun<E, U>` to `Exun<E, T>` by applying a function to a /// contained [`Unexpected`] value, leaving an [`Expected`] value /// untouched. /// @@ -155,5 +155,6 @@ pub use result::ResultMsgExt; pub use unexpected::{RawUnexpected, UnexpectedError}; pub use Exun::{Expected, Unexpected}; +/// A type alias for [`Exun<E, RawUnexpected`] #[cfg(feature = "alloc")] pub type Expect<E> = Exun<E, RawUnexpected>; diff --git a/src/result.rs b/src/result.rs index dfcb7ef..987fc3a 100644 --- a/src/result.rs +++ b/src/result.rs @@ -15,7 +15,7 @@ use sealed::Sealed; /// [`Result::unexpect`]: `ResultErrorExt::unexpect` #[cfg(feature = "std")] pub trait ResultErrorExt<T>: Sealed { - /// Converts `Result<T, E>` to `Result<T, RawUnexpected>`. + /// Converts [`Result<T, E>`] to [`Result<T, RawUnexpected>`]. /// /// # Examples /// @@ -69,7 +69,7 @@ impl<T, E: Error + Send + Sync + 'static> ResultErrorExt<T> for Result<T, E> { /// /// [`Result::unexpect_msg`]: `ResultMsgExt::unexpect_msg` pub trait ResultMsgExt<T>: Sealed { - /// Converts `Result<T, E>` to `Result<T, RawUnExpected>`. + /// 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. |
