From 0e22146f1a95deeee5b456a01f534c3b00f806df Mon Sep 17 00:00:00 2001 From: matteopolak Date: Sun, 14 Jul 2024 15:09:08 -0400 Subject: [PATCH] feat: add `ErrorDescription::into_inner` --- jsonschema/src/output.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jsonschema/src/output.rs b/jsonschema/src/output.rs index e577fadf..01e78368 100644 --- a/jsonschema/src/output.rs +++ b/jsonschema/src/output.rs @@ -318,6 +318,14 @@ impl<'a> From for Annotations<'a> { #[derive(serde::Serialize, Debug, Clone, PartialEq, Eq)] pub struct ErrorDescription(String); +impl ErrorDescription { + /// Returns the inner [`String`] of the error description. + #[inline] + pub fn into_inner(self) -> String { + self.0 + } +} + impl fmt::Display for ErrorDescription { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(&self.0)