Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make strings in error types public #425

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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