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::<u16>()` | = 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 ```
This commit is contained in:
parent
9b57268efe
commit
d2ff4a1cff
|
@ -116,7 +116,7 @@ pub fn Reply_code(input: &[u8]) -> IResult<&[u8], u16> {
|
||||||
take_while_m_n(3, 3, nom::character::is_digit),
|
take_while_m_n(3, 3, nom::character::is_digit),
|
||||||
std::str::from_utf8,
|
std::str::from_utf8,
|
||||||
),
|
),
|
||||||
|s| u16::from_str_radix(s, 10),
|
str::parse,
|
||||||
)(input)
|
)(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue