aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/components/gfx/platform/android/font_context.rs2
-rw-r--r--src/components/gfx/platform/android/font_list.rs2
-rw-r--r--src/components/gfx/text/util.rs60
-rw-r--r--src/components/main/platform/common/glut_windowing.rs4
-rw-r--r--src/components/style/selector_matching.rs10
-rw-r--r--src/components/style/selectors.rs30
-rw-r--r--src/components/util/str.rs2
7 files changed, 55 insertions, 55 deletions
diff --git a/src/components/gfx/platform/android/font_context.rs b/src/components/gfx/platform/android/font_context.rs
index a6df2b55a52..af65a30aa22 100644
--- a/src/components/gfx/platform/android/font_context.rs
+++ b/src/components/gfx/platform/android/font_context.rs
@@ -49,7 +49,7 @@ impl FontContextHandleMethods for FontContextHandle {
debug!("Creating font handle for {:s}", name);
path_from_identifier(name, &style).and_then(|file_name| {
debug!("Opening font face {:s}", file_name);
- FontHandle::new_from_file(self, file_name.to_owned(), &style)
+ FontHandle::new_from_file(self, file_name.to_string(), &style)
})
}
}
diff --git a/src/components/gfx/platform/android/font_list.rs b/src/components/gfx/platform/android/font_list.rs
index 8d5649096b7..52a173d45bd 100644
--- a/src/components/gfx/platform/android/font_list.rs
+++ b/src/components/gfx/platform/android/font_list.rs
@@ -130,7 +130,7 @@ impl FontListHandle {
}
pub fn get_last_resort_font_families() -> Vec<~str> {
- vec!("Roboto".to_owned())
+ vec!("Roboto".to_string())
}
}
diff --git a/src/components/gfx/text/util.rs b/src/components/gfx/text/util.rs
index af3e01819e3..f3102e0189a 100644
--- a/src/components/gfx/text/util.rs
+++ b/src/components/gfx/text/util.rs
@@ -195,21 +195,21 @@ fn test_transform_discard_newline() {
/* FIXME: Fix and re-enable
#[test]
fn test_transform_compress_whitespace() {
- let test_strs : ~[String] = ~[" foo bar".to_owned(),
- "foo bar ".to_owned(),
- "foo\n bar".to_owned(),
- "foo \nbar".to_owned(),
- " foo bar \nbaz".to_owned(),
- "foo bar baz".to_owned(),
- "foobarbaz\n\n".to_owned()];
-
- let oracle_strs : ~[String] = ~[" foo bar".to_owned(),
- "foo bar ".to_owned(),
- "foo\n bar".to_owned(),
- "foo \nbar".to_owned(),
- " foo bar \nbaz".to_owned(),
- "foo bar baz".to_owned(),
- "foobarbaz\n\n".to_owned()];
+ let test_strs : ~[String] = ~[" foo bar".to_string(),
+ "foo bar ".to_string(),
+ "foo\n bar".to_string(),
+ "foo \nbar".to_string(),
+ " foo bar \nbaz".to_string(),
+ "foo bar baz".to_string(),
+ "foobarbaz\n\n".to_string()];
+
+ let oracle_strs : ~[String] = ~[" foo bar".to_string(),
+ "foo bar ".to_string(),
+ "foo\n bar".to_string(),
+ "foo \nbar".to_string(),
+ " foo bar \nbaz".to_string(),
+ "foo bar baz".to_string(),
+ "foobarbaz\n\n".to_string()];
assert_eq!(test_strs.len(), oracle_strs.len());
let mode = CompressWhitespace;
@@ -223,21 +223,21 @@ fn test_transform_compress_whitespace() {
#[test]
fn test_transform_compress_whitespace_newline() {
- let test_strs : ~[String] = ~[" foo bar".to_owned(),
- "foo bar ".to_owned(),
- "foo\n bar".to_owned(),
- "foo \nbar".to_owned(),
- " foo bar \nbaz".to_owned(),
- "foo bar baz".to_owned(),
- "foobarbaz\n\n".to_owned()];
-
- let oracle_strs : ~[String] = ~["foo bar".to_owned(),
- "foo bar ".to_owned(),
- "foo bar".to_owned(),
- "foo bar".to_owned(),
- " foo bar baz".to_owned(),
- "foo bar baz".to_owned(),
- "foobarbaz ".to_owned()];
+ let test_strs : ~[String] = ~[" foo bar".to_string(),
+ "foo bar ".to_string(),
+ "foo\n bar".to_string(),
+ "foo \nbar".to_string(),
+ " foo bar \nbaz".to_string(),
+ "foo bar baz".to_string(),
+ "foobarbaz\n\n".to_string()];
+
+ let oracle_strs : ~[String] = ~["foo bar".to_string(),
+ "foo bar ".to_string(),
+ "foo bar".to_string(),
+ "foo bar".to_string(),
+ " foo bar baz".to_string(),
+ "foo bar baz".to_string(),
+ "foobarbaz ".to_string()];
assert_eq!(test_strs.len(), oracle_strs.len());
let mode = CompressWhitespaceNewline;
diff --git a/src/components/main/platform/common/glut_windowing.rs b/src/components/main/platform/common/glut_windowing.rs
index 4465bef791f..e14728c10d2 100644
--- a/src/components/main/platform/common/glut_windowing.rs
+++ b/src/components/main/platform/common/glut_windowing.rs
@@ -65,7 +65,7 @@ impl WindowMethods<Application> for Window {
fn new(_: &Application, _: bool) -> Rc<Window> {
// Create the GLUT window.
glut::init_window_size(800, 600);
- let glut_window = glut::create_window("Servo".to_owned());
+ let glut_window = glut::create_window("Servo".to_string());
// Create our window object.
let window = Window {
@@ -275,7 +275,7 @@ impl Window {
alert.run();
let value = alert.prompt_value();
if "" == value { // To avoid crashing on Linux.
- self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_owned()))
+ self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_string()))
} else {
self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone()))
}
diff --git a/src/components/style/selector_matching.rs b/src/components/style/selector_matching.rs
index 061a8fc76b5..1a3752603ee 100644
--- a/src/components/style/selector_matching.rs
+++ b/src/components/style/selector_matching.rs
@@ -980,23 +980,23 @@ mod tests {
fn test_get_id_name(){
let rules_list = get_mock_rules([".intro", "#top"]);
assert_eq!(SelectorMap::get_id_name(rules_list.get(0).get(0)), None);
- assert_eq!(SelectorMap::get_id_name(rules_list.get(1).get(0)), Some("top".to_owned()));
+ assert_eq!(SelectorMap::get_id_name(rules_list.get(1).get(0)), Some("top".to_string()));
}
#[test]
fn test_get_class_name(){
let rules_list = get_mock_rules([".intro.foo", "#top"]);
- assert_eq!(SelectorMap::get_class_name(rules_list.get(0).get(0)), Some("intro".to_owned()));
+ assert_eq!(SelectorMap::get_class_name(rules_list.get(0).get(0)), Some("intro".to_string()));
assert_eq!(SelectorMap::get_class_name(rules_list.get(1).get(0)), None);
}
#[test]
fn test_get_element_name(){
let rules_list = get_mock_rules(["img.foo", "#top", "IMG", "ImG"]);
- assert_eq!(SelectorMap::get_element_name(rules_list.get(0).get(0)), Some("img".to_owned()));
+ assert_eq!(SelectorMap::get_element_name(rules_list.get(0).get(0)), Some("img".to_string()));
assert_eq!(SelectorMap::get_element_name(rules_list.get(1).get(0)), None);
- assert_eq!(SelectorMap::get_element_name(rules_list.get(2).get(0)), Some("img".to_owned()));
- assert_eq!(SelectorMap::get_element_name(rules_list.get(3).get(0)), Some("img".to_owned()));
+ assert_eq!(SelectorMap::get_element_name(rules_list.get(2).get(0)), Some("img".to_string()));
+ assert_eq!(SelectorMap::get_element_name(rules_list.get(3).get(0)), Some("img".to_string()));
}
#[test]
diff --git a/src/components/style/selectors.rs b/src/components/style/selectors.rs
index 30497988f0d..6acb818f098 100644
--- a/src/components/style/selectors.rs
+++ b/src/components/style/selectors.rs
@@ -595,7 +595,7 @@ mod tests {
assert!(parse("") == None)
assert!(parse("e") == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
- simple_selectors: vec!(LocalNameSelector("e".to_owned())),
+ simple_selectors: vec!(LocalNameSelector("e".to_string())),
next: None,
}),
pseudo_element: None,
@@ -603,7 +603,7 @@ mod tests {
})))
assert!(parse(".foo") == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
- simple_selectors: vec!(ClassSelector("foo".to_owned())),
+ simple_selectors: vec!(ClassSelector("foo".to_string())),
next: None,
}),
pseudo_element: None,
@@ -611,7 +611,7 @@ mod tests {
})))
assert!(parse("#bar") == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
- simple_selectors: vec!(IDSelector("bar".to_owned())),
+ simple_selectors: vec!(IDSelector("bar".to_string())),
next: None,
}),
pseudo_element: None,
@@ -619,9 +619,9 @@ mod tests {
})))
assert!(parse("e.foo#bar") == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
- simple_selectors: vec!(LocalNameSelector("e".to_owned()),
- ClassSelector("foo".to_owned()),
- IDSelector("bar".to_owned())),
+ simple_selectors: vec!(LocalNameSelector("e".to_string()),
+ ClassSelector("foo".to_string()),
+ IDSelector("bar".to_string())),
next: None,
}),
pseudo_element: None,
@@ -629,10 +629,10 @@ mod tests {
})))
assert!(parse("e.foo #bar") == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
- simple_selectors: vec!(IDSelector("bar".to_owned())),
+ simple_selectors: vec!(IDSelector("bar".to_string())),
next: Some((box CompoundSelector {
- simple_selectors: vec!(LocalNameSelector("e".to_owned()),
- ClassSelector("foo".to_owned())),
+ simple_selectors: vec!(LocalNameSelector("e".to_string()),
+ ClassSelector("foo".to_string())),
next: None,
}, Descendant)),
}),
@@ -645,8 +645,8 @@ mod tests {
assert!(parse_ns("[Foo]", &namespaces) == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
simple_selectors: vec!(AttrExists(AttrSelector {
- name: "Foo".to_owned(),
- lower_name: "foo".to_owned(),
+ name: "Foo".to_string(),
+ lower_name: "foo".to_string(),
namespace: SpecificNamespace(namespace::Null),
})),
next: None,
@@ -660,8 +660,8 @@ mod tests {
assert!(parse_ns("[Foo]", &namespaces) == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
simple_selectors: vec!(AttrExists(AttrSelector {
- name: "Foo".to_owned(),
- lower_name: "foo".to_owned(),
+ name: "Foo".to_string(),
+ lower_name: "foo".to_string(),
namespace: SpecificNamespace(namespace::Null),
})),
next: None,
@@ -674,7 +674,7 @@ mod tests {
compound_selectors: Arc::new(CompoundSelector {
simple_selectors: vec!(
NamespaceSelector(namespace::MathML),
- LocalNameSelector("e".to_owned()),
+ LocalNameSelector("e".to_string()),
),
next: None,
}),
@@ -694,7 +694,7 @@ mod tests {
compound_selectors: Arc::new(CompoundSelector {
simple_selectors: vec!(),
next: Some((box CompoundSelector {
- simple_selectors: vec!(LocalNameSelector("div".to_owned())),
+ simple_selectors: vec!(LocalNameSelector("div".to_string())),
next: None,
}, Descendant)),
}),
diff --git a/src/components/util/str.rs b/src/components/util/str.rs
index 28412dd55e7..69e50a78e59 100644
--- a/src/components/util/str.rs
+++ b/src/components/util/str.rs
@@ -10,7 +10,7 @@ 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 "".to_owned() even for Some.
+ // We don't use map_default because it would allocate "".to_string() even for Some.
match *s {
Some(ref s) => s.clone(),
None => "".to_string()