Skip to content

Commit 1ecc826

Browse files
committed
iterate over bytes, as we expect only portion of ascii range
1 parent 41556b5 commit 1ecc826

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
@@ -69,8 +69,8 @@ pub fn demangle(mut s: &str) -> Demangle<'_> {
6969
let llvm = ".llvm.";
7070
if let Some(i) = s.find(llvm) {
7171
let candidate = &s[i + llvm.len()..];
72-
let all_hex = candidate.chars().all(|c| match c {
73-
'A'..='F' | '0'..='9' | '@' => true,
72+
let all_hex = candidate.bytes().all(|c| match c {
73+
b'A'..=b'F' | b'0'..=b'9' | b'@' => true,
7474
_ => false,
7575
});
7676

0 commit comments

Comments
 (0)