clippy: fix byte_char_slices lint

https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices

Part of #12658
This commit is contained in:
xtqqczze
2026-04-20 02:23:02 +01:00
committed by Johannes Altmanninger
parent 1dfc75bb9c
commit f3e43e932f

View File

@@ -398,7 +398,7 @@ fn escape_string_url(input: &wstr) -> WString {
for byte in narrow {
if (byte & 0x80) == 0 {
let c = char::from_u32(u32::from(byte)).unwrap();
if c.is_alphanumeric() || [b'/', b'.', b'~', b'-', b'_'].contains(&byte) {
if c.is_alphanumeric() || b"/.~-_".contains(&byte) {
// The above characters don't need to be encoded.
out.push(c);
continue;