Skip to content

Commit

Permalink
Use unreachable!() instead of panic!() where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
mqudsi committed Jun 16, 2022
1 parent 98b188d commit 3451866
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ impl Unit {
},
style @ _ => match bytes {
1 => match style {
Style::Smart => panic!("already covered above"),
Style::Smart => unreachable!("already covered above"),
Style::FullLowerCase => write!(fmt, " {}", self.text().0),
Style::Full => write!(fmt, " {}", self.text().1),
Style::AbbreviatedLowerCase => write!(fmt, " {}", self.text().2),
Style::Abbreviated => write!(fmt, " {}", self.text().3),
},
_ => match style {
Style::Smart => panic!("already covered above"),
Style::Smart => unreachable!("already covered above"),
Style::FullLowerCase => write!(fmt, " {}s", self.text().0),
Style::Full => write!(fmt, " {}s", self.text().1),
Style::AbbreviatedLowerCase => write!(fmt, " {}", self.text().2),
Expand Down

0 comments on commit 3451866

Please sign in to comment.