From d2ff4a1cffe708430f3eb565d69f5e4df72352ff Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Date: Thu, 6 Oct 2022 21:53:46 +0200 Subject: [PATCH] Simplify a string parsing line This fixes a clippy warning but does even better than suggested: ``` warning: this call to `from_str_radix` can be replaced with a call to `str::parse` --> src/parse/response.rs:119:13 | 119 | |s| u16::from_str_radix(s, 10), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `s.parse::()` | = note: `#[warn(clippy::from_str_radix_10)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 ``` --- src/parse/response.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parse/response.rs b/src/parse/response.rs index 115dc87..148f443 100644 --- a/src/parse/response.rs +++ b/src/parse/response.rs @@ -116,7 +116,7 @@ pub fn Reply_code(input: &[u8]) -> IResult<&[u8], u16> { take_while_m_n(3, 3, nom::character::is_digit), std::str::from_utf8, ), - |s| u16::from_str_radix(s, 10), + str::parse, )(input) }