Skip to content

Commit

Permalink
cleaner error Display
Browse files Browse the repository at this point in the history
  • Loading branch information
rogusdev committed May 22, 2024
1 parent 258f961 commit 37c900a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ pub enum DecodeError {
impl std::fmt::Display for DecodeError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
DecodeError::InvalidChar { char, index } => {
Self::InvalidChar { char, index } => {
write!(f, "Invalid char of '{char}' at position {index}")
}
DecodeError::InvalidLength { length } => {
Self::InvalidLength { length } => {
write!(f, "Invalid length of {length}")
} // DecodeError::InvalidBits { byte, index } => {
} // Self::InvalidBits { byte, index } => {
// write!(f, "Invalid bits in {byte} at position {index}")
// }
}
Expand Down

0 comments on commit 37c900a

Please sign in to comment.