Skip to content

Commit ea57d6e

Browse files
committed
Use contains instead of manual implementation
Clippy emits: warning: manual `!RangeInclusive::contains` implementation As suggested, use contains instead of manual implementation.
1 parent 7b91918 commit ea57d6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/expression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<'a> Tree<'a> {
195195
pub fn parse_num(s: &str) -> Result<u32, Error> {
196196
if s.len() > 1 {
197197
let ch = s.chars().next().unwrap();
198-
if ch < '1' || ch > '9' {
198+
if !('1'..='9').contains(&ch) {
199199
return Err(Error::Unexpected(
200200
"Number must start with a digit 1-9".to_string(),
201201
));

0 commit comments

Comments
 (0)