Fix clippy is_digit_ascii_radix

This commit is contained in:
Fabrice Reix 2022-06-30 21:58:46 +02:00
parent 1c8713ebe4
commit 487ab2ef53
No known key found for this signature in database
GPG Key ID: BF5213154B2E7155
2 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,7 @@ pub fn natural(reader: &mut Reader) -> ParseResult<'static, usize> {
});
}
let first_digit = reader.read().unwrap();
if !first_digit.is_digit(10) {
if !first_digit.is_ascii_digit() {
return Err(Error {
pos: start.pos,
recoverable: true,
@ -44,7 +44,7 @@ pub fn natural(reader: &mut Reader) -> ParseResult<'static, usize> {
}
let save = reader.state.clone();
let s = reader.read_while(|c| c.is_digit(10));
let s = reader.read_while(|c| c.is_ascii_digit());
// if the first digit is zero, you should not have any more digits
if first_digit == '0' && !s.is_empty() {
@ -79,7 +79,7 @@ pub fn number(reader: &mut Reader) -> ParseResult<'static, Number> {
});
}
let s = reader.read_while(|c| c.is_digit(10));
let s = reader.read_while(|c| c.is_ascii_digit());
if s.is_empty() {
return Err(Error {
pos: reader.clone().state.pos,

View File

@ -431,7 +431,7 @@ pub fn natural(reader: &mut Reader) -> ParseResult<'static, u64> {
});
}
let first_digit = reader.read().unwrap();
if !first_digit.is_digit(10) {
if !first_digit.is_ascii_digit() {
return Err(Error {
pos: start.pos,
recoverable: true,
@ -442,7 +442,7 @@ pub fn natural(reader: &mut Reader) -> ParseResult<'static, u64> {
}
let save = reader.state.clone();
let s = reader.read_while(|c| c.is_digit(10));
let s = reader.read_while(|c| c.is_ascii_digit());
// if the first digit is zero, you should not have any more digits
if first_digit == '0' && !s.is_empty() {
@ -487,7 +487,7 @@ pub fn float(reader: &mut Reader) -> ParseResult<'static, Float> {
});
}
let s = reader.read_while(|c| c.is_digit(10));
let s = reader.read_while(|c| c.is_ascii_digit());
if s.is_empty() {
return Err(Error {
pos: reader.clone().state.pos,