Skip to content

Commit

Permalink
Make struct error internals public
Browse files Browse the repository at this point in the history
Its better if a struct error has a public inner field so users can
access it in ways other than through `Display`.

Audit all the struct errors (only found one) and add `pub` to the inner
field.
  • Loading branch information
tcharding committed Oct 16, 2023
1 parent ac24f23 commit c89065d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/primitives/segwit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn validate_witness_program_length(
/// Field element does not represent a valid witness version.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct InvalidWitnessVersionError(Fe32);
pub struct InvalidWitnessVersionError(pub Fe32);

impl fmt::Display for InvalidWitnessVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down

0 comments on commit c89065d

Please sign in to comment.