From e89bd1562c9fd8e2ce8ccad1a380d83a4f1d7f24 Mon Sep 17 00:00:00 2001 From: Nick Babcock Date: Mon, 15 Jan 2024 10:45:16 -0600 Subject: [PATCH] Apply clippy suggestion to binary token cli --- src/bin/token.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/token.rs b/src/bin/token.rs index 7cd4c72..eed2575 100644 --- a/src/bin/token.rs +++ b/src/bin/token.rs @@ -28,7 +28,7 @@ fn main() -> Result<(), Box> { 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::() { Ok(token) => Needle::Token(token), Err(_) => Needle::String(String::from(x)), },