Skip to content

Commit dc2075d

Browse files
committed
Use RangeInclusive::contains instead of manually implementing it
1 parent 8e64590 commit dc2075d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/c_macro.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ include!(concat!(env!("OUT_DIR"), "/gen_c_macros.rs"));
55

66
#[inline(always)]
77
fn is_identifier_part(c: u8) -> bool {
8-
(b'A' <= c && b'Z' >= c) || (b'a' <= c && b'z' >= c) || (b'0' <= c && b'9' >= c) || c == b'_'
8+
(b'A'..=b'Z').contains(&c)
9+
|| (b'a'..=b'z').contains(&c)
10+
|| (b'0'..=b'9').contains(&c)
11+
|| c == b'_'
912
}
1013

1114
#[inline(always)]
1215
fn is_identifier_starter(c: u8) -> bool {
13-
(b'A' <= c && b'Z' >= c) || (b'a' <= c && b'z' >= c) || c == b'_'
16+
(b'A'..=b'Z').contains(&c) || (b'a'..=b'z').contains(&c) || c == b'_'
1417
}
1518

1619
#[inline(always)]

0 commit comments

Comments
 (0)