Remove some as_slice calls.

This commit is contained in:
Ms2ger 2015-04-24 17:40:22 +02:00
parent 4ee89363fb
commit 6a55ae06d7
34 changed files with 79 additions and 79 deletions

View file

@ -12,6 +12,7 @@ use std::borrow::ToOwned;
use std::ffi::CStr;
use std::iter::Filter;
use std::num::{Int, ToPrimitive};
use std::ops::Deref;
use std::str::{from_utf8, FromStr, Split};
pub type DOMString = String;
@ -29,7 +30,7 @@ pub fn null_str_as_empty(s: &Option<DOMString>) -> DOMString {
pub fn null_str_as_empty_ref<'a>(s: &'a Option<DOMString>) -> &'a str {
match *s {
Some(ref s) => s.as_slice(),
Some(ref s) => s,
None => ""
}
}
@ -231,7 +232,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
new_input.push(ch)
}
}
let mut input = new_input.as_slice();
let mut input = &*new_input;
// Step 8.
for (char_count, (index, _)) in input.char_indices().enumerate() {
@ -328,9 +329,11 @@ impl LowercaseString {
}
}
impl Str for LowercaseString {
impl Deref for LowercaseString {
type Target = str;
#[inline]
fn as_slice(&self) -> &str {
fn deref(&self) -> &str {
&*self.inner
}
}