From f52dc60a3c83d43be2b9df0e4a6e4fa0d704a7b3 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Sun, 23 Oct 2022 12:51:39 -0400 Subject: Seal the Result extensions --- src/result.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/result.rs b/src/result.rs index 94ebab2..03483d2 100644 --- a/src/result.rs +++ b/src/result.rs @@ -3,8 +3,15 @@ use std::error::Error; use crate::{unexpected::Errorable, UnexpectedError}; +mod sealed { + pub trait Sealed {} + impl Sealed for Result {} +} + +use sealed::Sealed; + #[cfg(feature = "std")] -pub trait ResultErrorExt { +pub trait ResultErrorExt: Sealed { /// Converts `Result` to `Result`. #[allow(clippy::missing_errors_doc)] fn unexpect(self) -> Result; @@ -17,7 +24,7 @@ impl ResultErrorExt for Result { } } -pub trait ResultMsgExt { +pub trait ResultMsgExt: Sealed { /// Converts `Result` to `Result`. /// /// This is provided for compatibility with `no_std`. If your type -- cgit v1.2.3