mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Simplify URLSearchParams::serialize's percent-encoding.
This commit is contained in:
parent
5dd43bf84c
commit
f45db7714c
1 changed files with 1 additions and 7 deletions
|
@ -135,13 +135,7 @@ impl URLSearchParamsHelpers for URLSearchParams {
|
||||||
|
|
||||||
// Encode everything else using 'percented-encoded bytes'
|
// Encode everything else using 'percented-encoded bytes'
|
||||||
// http://url.spec.whatwg.org/#percent-encode
|
// http://url.spec.whatwg.org/#percent-encode
|
||||||
a => {
|
a => format!("%{:X}", a).into_bytes(),
|
||||||
let mut encoded = vec!(0x25); // %
|
|
||||||
let s = format!("{}", radix(a, 16)).into_ascii_uppercase();
|
|
||||||
let bytes = s.as_bytes();
|
|
||||||
encoded.push_all(bytes);
|
|
||||||
encoded
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
buf.push_all(&append);
|
buf.push_all(&append);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue