diff options
author | Corey Farwell <coreyf@rwell.org> | 2015-03-29 13:33:02 -0400 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2015-03-29 14:42:19 -0400 |
commit | d838fcce30d56e02bd22c4bcfca04d39bf4fc38e (patch) | |
tree | 3a906417b1c164990bc308ff790913b9c7c08740 /components/script/cors.rs | |
parent | b8ea10bfe3386357b68e5564332cf8ac9d5377bb (diff) | |
download | servo-d838fcce30d56e02bd22c4bcfca04d39bf4fc38e.tar.gz servo-d838fcce30d56e02bd22c4bcfca04d39bf4fc38e.zip |
Remove some unnecessary uses of `as_slice`
For the majority of these cases, `as_slice` can be removed due to
`Deref`. In particular, `Deref` for:
* `String` -> `str`
* `Atom` -> `str`
The latter of those two requires, a bump of the locked `string-cache`
library
Diffstat (limited to 'components/script/cors.rs')
-rw-r--r-- | components/script/cors.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/cors.rs b/components/script/cors.rs index 6930848bb7c..c11f8233c4a 100644 --- a/components/script/cors.rs +++ b/components/script/cors.rs @@ -171,7 +171,7 @@ impl CORSRequest { }; // Substep 4 if methods.len() == 0 || preflight.mode == RequestMode::ForcedPreflight { - methods = methods_substep4.as_slice(); + methods = &methods_substep4; } // Substep 5 if !is_simple_method(&self.method) && @@ -183,7 +183,7 @@ impl CORSRequest { if is_simple_header(&h) { continue; } - if !headers.iter().any(|ref h2| h.name().eq_ignore_ascii_case(h2.as_slice())) { + if !headers.iter().any(|ref h2| h.name().eq_ignore_ascii_case(h2)) { return error; } } @@ -254,7 +254,7 @@ pub enum HeaderOrMethod { impl HeaderOrMethod { fn match_header(&self, header_name: &str) -> bool { match *self { - HeaderOrMethod::HeaderData(ref s) => s.as_slice().eq_ignore_ascii_case(header_name), + HeaderOrMethod::HeaderData(ref s) => s.eq_ignore_ascii_case(header_name), _ => false } } |