mirror of
https://github.com/servo/servo.git
synced 2025-08-01 03:30:33 +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'
|
||||
// http://url.spec.whatwg.org/#percent-encode
|
||||
a => {
|
||||
let mut encoded = vec!(0x25); // %
|
||||
let s = format!("{}", radix(a, 16)).into_ascii_uppercase();
|
||||
let bytes = s.as_bytes();
|
||||
encoded.push_all(bytes);
|
||||
encoded
|
||||
}
|
||||
a => format!("%{:X}", a).into_bytes(),
|
||||
};
|
||||
buf.push_all(&append);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue