Skip to content

Commit

Permalink
Do not manually check for ascii range
Browse files Browse the repository at this point in the history
Clippy emits:

 error: manual check for common ascii range

As suggested, use `is_ascii_*` methods instead of checking for ascii
rang manually.
  • Loading branch information
tcharding committed Mar 22, 2023
1 parent a21d3ed commit 18214b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ fn check_hrp(hrp: &str) -> Result<Case, Error> {
return Err(Error::InvalidChar(b as char));
}

if (b'a'..=b'z').contains(&b) {
if b.is_ascii_lowercase() {
has_lower = true;
} else if (b'A'..=b'Z').contains(&b) {
} else if b.is_ascii_uppercase() {
has_upper = true;
};

Expand Down

0 comments on commit 18214b2

Please sign in to comment.