mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Move to to_owned rather than into_string.
into_string has been removed from Rust.
This commit is contained in:
parent
2d5b0e0855
commit
01ed338746
67 changed files with 473 additions and 383 deletions
|
@ -6,6 +6,7 @@ use geometry::Au;
|
|||
|
||||
use cssparser::{mod, RGBA, Color};
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::ToOwned;
|
||||
use std::iter::Filter;
|
||||
use std::num::Int;
|
||||
use std::str::{CharEq, CharSplits, FromStr};
|
||||
|
@ -16,11 +17,11 @@ pub type StaticCharVec = &'static [char];
|
|||
pub type StaticStringVec = &'static [&'static str];
|
||||
|
||||
pub fn null_str_as_empty(s: &Option<DOMString>) -> DOMString {
|
||||
// We don't use map_default because it would allocate "".into_string() even
|
||||
// We don't use map_default because it would allocate "".to_owned() even
|
||||
// for Some.
|
||||
match *s {
|
||||
Some(ref s) => s.clone(),
|
||||
None => "".into_string()
|
||||
None => "".to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue