Skip to content

Commit

Permalink
Lexer: Fix a few warnings
Browse files Browse the repository at this point in the history
* Changed range check to `.is_ascii_digit()`
* Made integer suffix array to only `&str` instead of `&'static str`,
  because it is already implicit
  • Loading branch information
SkillerRaptor committed Jul 6, 2023
1 parent 720295a commit a57fc32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lexer/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn token_identifier() {
for i in 1..100 {
let string = Alphanumeric.sample_string(&mut rand::thread_rng(), i);

if ('0'..='9').contains(&(string.as_bytes()[0] as char)) {
if (string.as_bytes()[0] as char).is_ascii_digit() {
continue;
}

Expand All @@ -200,7 +200,7 @@ fn token_identifier() {
}
}

const INTEGER_SUFFIXES: [&'static str; 6] = ["u", "ul", "ull", "l", "lu", "llu"];
const INTEGER_SUFFIXES: [&str; 6] = ["u", "ul", "ull", "l", "lu", "llu"];

#[test]
fn test_decimal() {
Expand Down

0 comments on commit a57fc32

Please sign in to comment.