Skip to content

Commit e8ec998

Browse files
fix: crates are limited to ASCII values
1 parent ea585ef commit e8ec998

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_lints/src/cargo/multiple_crate_versions.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ pub(super) fn check(cx: &LateContext<'_>, metadata: &Metadata) {
2020
// local_name contains the crate name as a namespace, with the dashes converted to underscores
2121
// the code below temporarily rectifies this discrepancy
2222
if p.name
23-
.chars()
24-
.map(|c| if c == '-' { '_' } else { c })
25-
.eq(local_name.as_str().chars())
23+
.as_bytes()
24+
.iter()
25+
.map(|b| if b == &b'-' { &b'_' } else { b })
26+
.eq(local_name.as_str().as_bytes())
2627
{
2728
Some(&p.id)
2829
} else {

0 commit comments

Comments
 (0)