Skip to content

Commit

Permalink
Apply clippy suggestion to binary token cli
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbabcock committed Jan 15, 2024
1 parent 2bd2e85 commit e89bd15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bin/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
let needle = match args.get(1) {
Some(x) => match x.strip_prefix("0x") {
Some(hex) => Needle::Token(u16::from_str_radix(hex, 16).expect("hex")),
None => match u16::from_str_radix(x, 10) {
None => match x.parse::<u16>() {
Ok(token) => Needle::Token(token),
Err(_) => Needle::String(String::from(x)),
},
Expand Down

0 comments on commit e89bd15

Please sign in to comment.