diff options
Diffstat (limited to 'src/unexpected.rs')
| -rw-r--r-- | src/unexpected.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/unexpected.rs b/src/unexpected.rs index 20a71c9..cc07728 100644 --- a/src/unexpected.rs +++ b/src/unexpected.rs @@ -214,6 +214,18 @@ impl From<RawUnexpected> for UnexpectedError { } } +impl From<&'static str> for UnexpectedError { + fn from(value: &'static str) -> Self { + Self(RawUnexpected::msg(value)) + } +} + +impl From<String> for UnexpectedError { + fn from(value: String) -> Self { + Self(RawUnexpected::msg(value)) + } +} + impl Display for UnexpectedError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { Display::fmt(&self.0, f) |
