From c089a353ae1c30edfeb794b7b3bdd0d225766865 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Sun, 23 Oct 2022 12:49:40 -0400 Subject: Export Result extensions --- src/result.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/result.rs') diff --git a/src/result.rs b/src/result.rs index d5de01b..94ebab2 100644 --- a/src/result.rs +++ b/src/result.rs @@ -4,7 +4,9 @@ use std::error::Error; use crate::{unexpected::Errorable, UnexpectedError}; #[cfg(feature = "std")] -trait ResultErrorExt { +pub trait ResultErrorExt { + /// Converts `Result` to `Result`. + #[allow(clippy::missing_errors_doc)] fn unexpect(self) -> Result; } @@ -15,7 +17,12 @@ impl ResultErrorExt for Result { } } -trait ResultMsgExt { +pub trait ResultMsgExt { + /// Converts `Result` to `Result`. + /// + /// 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; } -- cgit v1.2.3