Skip to content

Commit

Permalink
Make strings in error types public
Browse files Browse the repository at this point in the history
  • Loading branch information
okamt committed Nov 10, 2024
1 parent 5263c72 commit f9bc12c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> TryIntoError<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/try_unwrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ pub struct TryUnwrapError<T> {
///
/// [`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<T> TryUnwrapError<T> {
Expand Down

0 comments on commit f9bc12c

Please sign in to comment.