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:
Zeeshan Ali 2022-10-06 21:53:46 +02:00 committed by Damian Poddebniak
parent 9b57268efe
commit d2ff4a1cff
1 changed files with 1 additions and 1 deletions

View File

@ -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)
} }