From f9bc12ca0ead779aac9f498bcfe254203b2cb67a Mon Sep 17 00:00:00 2001 From: Matheus Okamoto <128179754+okamt@users.noreply.github.com> Date: Sun, 10 Nov 2024 16:37:19 -0300 Subject: [PATCH] Make strings in error types public --- src/add.rs | 2 +- src/convert.rs | 4 ++-- src/ops.rs | 2 +- src/str.rs | 2 +- src/try_unwrap.rs | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/add.rs b/src/add.rs index acb9e4ca..175679c9 100644 --- a/src/add.rs +++ b/src/add.rs @@ -8,7 +8,7 @@ use crate::UnitError; /// operation is invoked on mismatched enum variants. #[derive(Clone, Copy, Debug)] pub struct WrongVariantError { - operation_name: &'static str, + pub operation_name: &'static str, } impl WrongVariantError { diff --git a/src/convert.rs b/src/convert.rs index 9da11957..6a5394d6 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -61,8 +61,8 @@ mod try_into { /// /// [`TryInto`]: macro@crate::TryInto pub input: T, - variant_names: &'static str, - output_type: &'static str, + pub variant_names: &'static str, + pub output_type: &'static str, } impl TryIntoError { diff --git a/src/ops.rs b/src/ops.rs index 8b7b1477..e14755c1 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -6,7 +6,7 @@ use core::fmt; /// operation is invoked on a unit-like variant of an enum. #[derive(Clone, Copy, Debug)] pub struct UnitError { - operation_name: &'static str, + pub operation_name: &'static str, } impl UnitError { diff --git a/src/str.rs b/src/str.rs index 990281c8..0ac8e151 100644 --- a/src/str.rs +++ b/src/str.rs @@ -3,7 +3,7 @@ use core::fmt; /// Error of parsing an enum value its string representation. #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct FromStrError { - type_name: &'static str, + pub type_name: &'static str, } impl FromStrError { diff --git a/src/try_unwrap.rs b/src/try_unwrap.rs index 7761025e..20cb2465 100644 --- a/src/try_unwrap.rs +++ b/src/try_unwrap.rs @@ -8,9 +8,9 @@ pub struct TryUnwrapError { /// /// [`TryUnwrap`]: macro@crate::TryUnwrap pub input: T, - enum_name: &'static str, - variant_name: &'static str, - func_name: &'static str, + pub enum_name: &'static str, + pub variant_name: &'static str, + pub func_name: &'static str, } impl TryUnwrapError {