mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
This commit is contained in:
parent
26045d7fcb
commit
d1b433a3b3
160 changed files with 1427 additions and 1162 deletions
|
@ -16,9 +16,10 @@ use servo_util::str::DOMString;
|
|||
use encoding::all::UTF_8;
|
||||
use encoding::types::{EncodingRef, EncodeReplace};
|
||||
|
||||
use std::collections::hashmap::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::{Occupied, Vacant};
|
||||
use std::fmt::radix;
|
||||
use std::ascii::OwnedStrAsciiExt;
|
||||
use std::ascii::OwnedAsciiExt;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct URLSearchParams {
|
||||
|
@ -60,8 +61,15 @@ impl URLSearchParams {
|
|||
|
||||
impl<'a> URLSearchParamsMethods for JSRef<'a, URLSearchParams> {
|
||||
fn Append(self, name: DOMString, value: DOMString) {
|
||||
self.data.borrow_mut().insert_or_update_with(name, vec!(value.clone()),
|
||||
|_k, v| v.push(value.clone()));
|
||||
let mut data = self.data.borrow_mut();
|
||||
|
||||
match data.entry(name) {
|
||||
Occupied(entry) => entry.into_mut().push(value),
|
||||
Vacant(entry) => {
|
||||
entry.set(vec!(value));
|
||||
}
|
||||
}
|
||||
|
||||
self.update_steps();
|
||||
}
|
||||
|
||||
|
@ -109,8 +117,8 @@ impl URLSearchParamsHelpers for URLSearchParams {
|
|||
let append = match *i {
|
||||
0x20 => vec!(0x2B),
|
||||
0x2A | 0x2D | 0x2E |
|
||||
0x30 .. 0x39 | 0x41 .. 0x5A |
|
||||
0x5F | 0x61..0x7A => vec!(*i),
|
||||
0x30 ... 0x39 | 0x41 ... 0x5A |
|
||||
0x5F | 0x61...0x7A => vec!(*i),
|
||||
a => {
|
||||
// http://url.spec.whatwg.org/#percent-encode
|
||||
let mut encoded = vec!(0x25); // %
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue