Skip to content

Commit

Permalink
Split implementation of Display
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederik Rothenberger committed Sep 17, 2024
1 parent 8fcb8c9 commit effe1bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion identity_jose/src/jws/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,16 @@ impl FromStr for JwsAlgorithm {
}
}

#[cfg(not(feature = "custom_alg"))]
impl Display for JwsAlgorithm {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
f.write_str(&self.clone().name())
f.write_str(self.name())
}
}

#[cfg(feature = "custom_alg")]
impl Display for JwsAlgorithm {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
f.write_str(&(*self).name())
}
}

0 comments on commit effe1bd

Please sign in to comment.