fix: crates are limited to ASCII values

This commit is contained in:
Kristof Mattei 2024-01-14 14:00:13 -07:00
parent ea585ef321
commit e8ec99811b
No known key found for this signature in database
GPG key ID: 89668E582D199AA8

View file

@ -20,9 +20,10 @@ pub(super) fn check(cx: &LateContext<'_>, metadata: &Metadata) {
// local_name contains the crate name as a namespace, with the dashes converted to underscores
// the code below temporarily rectifies this discrepancy
if p.name
.chars()
.map(|c| if c == '-' { '_' } else { c })
.eq(local_name.as_str().chars())
.as_bytes()
.iter()
.map(|b| if b == &b'-' { &b'_' } else { b })
.eq(local_name.as_str().as_bytes())
{
Some(&p.id)
} else {