Skip to content

Commit 18214b2

Browse files
committed
Do not manually check for ascii range
Clippy emits: error: manual check for common ascii range As suggested, use `is_ascii_*` methods instead of checking for ascii rang manually.
1 parent a21d3ed commit 18214b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ fn check_hrp(hrp: &str) -> Result<Case, Error> {
415415
return Err(Error::InvalidChar(b as char));
416416
}
417417

418-
if (b'a'..=b'z').contains(&b) {
418+
if b.is_ascii_lowercase() {
419419
has_lower = true;
420-
} else if (b'A'..=b'Z').contains(&b) {
420+
} else if b.is_ascii_uppercase() {
421421
has_upper = true;
422422
};
423423

0 commit comments

Comments
 (0)