diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index eb0e473ca41..1e0b13b2ee3 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -211,7 +211,7 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> { } // Step 6 - let mut synthesized_declaration = String::from_str(&property); + let mut synthesized_declaration = property; synthesized_declaration.push_str(": "); synthesized_declaration.push_str(&value); diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 1ce9561d90a..786a3c25620 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -101,10 +101,10 @@ impl<'a> WebGLRenderingContextMethods for JSRef<'a, WebGLRenderingContext> { // TODO(ecoal95): Implement the missing parameters from the spec match parameter { WebGLRenderingContextConstants::VERSION => - DOMString::from_str("WebGL 1.0").to_jsval(cx), + "WebGL 1.0".to_jsval(cx), WebGLRenderingContextConstants::RENDERER | WebGLRenderingContextConstants::VENDOR => - DOMString::from_str("Mozilla/Servo").to_jsval(cx), + "Mozilla/Servo".to_jsval(cx), _ => NullValue(), } } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 8be87d5be17..c6de7bcca82 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1038,7 +1038,7 @@ fn should_move_clip_rect(clip_rect: Rect, new_viewport: Rect) -> bool{ } fn debug_reflow_events(goal: &ReflowGoal, query_type: &ReflowQueryType, reason: &ReflowReason) { - let mut debug_msg = String::from_str("****"); + let mut debug_msg = "****".to_owned(); debug_msg.push_str(match *goal { ReflowGoal::ForDisplay => "\tForDisplay", ReflowGoal::ForScriptQuery => "\tForScriptQuery", diff --git a/ports/cef/command_line.rs b/ports/cef/command_line.rs index dd932a22d74..9af3709f4cd 100644 --- a/ports/cef/command_line.rs +++ b/ports/cef/command_line.rs @@ -36,7 +36,7 @@ pub fn command_line_init(argc: c_int, argv: *const *const u8) { for i in 0..(argc as usize) { let slice = ffi::CStr::from_ptr(*argv.offset(i as isize) as *const c_char); let s = str::from_utf8(slice.to_bytes()).unwrap(); - a.push(String::from_str(s)); + a.push(s.to_owned()); } let cl = command_line_new(); (*cl).argc = argc; diff --git a/ports/cef/string_map.rs b/ports/cef/string_map.rs index 41225c9ed5a..b7fd8dffcc3 100644 --- a/ports/cef/string_map.rs +++ b/ports/cef/string_map.rs @@ -40,10 +40,9 @@ pub extern "C" fn cef_string_map_append(sm: *mut cef_string_map_t, key: *const c if sm.is_null() { return 0; } let v = string_map_to_treemap(sm); slice_to_str((*key).str as *const u8, (*key).length as usize, |result| { - let s = String::from_str(result); let csv = cef_string_userfree_utf16_alloc(); cef_string_utf16_set((*value).str as *const u16, (*value).length, csv, 1); - (*v).insert(s, csv); + (*v).insert(result.to_owned(), csv); 1 }) } @@ -55,7 +54,7 @@ pub extern "C" fn cef_string_map_find(sm: *mut cef_string_map_t, key: *const cef if sm.is_null() { return 0; } let v = string_map_to_treemap(sm); slice_to_str((*key).str as *const u8, (*key).length as usize, |result| { - match (*v).get(&String::from_str(result)) { + match (*v).get(result) { Some(s) => { cef_string_utf16_set((**s).str as *const u16, (**s).length, value, 1); 1 diff --git a/ports/cef/string_multimap.rs b/ports/cef/string_multimap.rs index 909039bc2ad..4640d9864b6 100644 --- a/ports/cef/string_multimap.rs +++ b/ports/cef/string_multimap.rs @@ -44,7 +44,7 @@ pub extern "C" fn cef_string_multimap_find_count(smm: *mut cef_string_multimap_t if smm.is_null() { return 0; } let v = string_multimap_to_treemap(smm); slice_to_str((*key).str as *const u8, (*key).length as usize, |result| { - match (*v).get(&String::from_str(result)) { + match (*v).get(result) { Some(s) => s.len() as c_int, None => 0 } @@ -58,12 +58,11 @@ pub extern "C" fn cef_string_multimap_append(smm: *mut cef_string_multimap_t, ke if smm.is_null() { return 0; } let v = string_multimap_to_treemap(smm); slice_to_str((*key).str as *const u8, (*key).length as usize, |result| { - let s = String::from_str(result); let csv = cef_string_userfree_utf16_alloc(); cef_string_utf16_set((*value).str as *const u16, (*value).length, csv, 1); - match (*v).get_mut(&s) { + match (*v).get_mut(result) { Some(vc) => (*vc).push(csv), - None => { (*v).insert(s, vec!(csv)); } + None => { (*v).insert(result.to_owned(), vec!(csv)); } } 1 }) @@ -76,7 +75,7 @@ pub extern "C" fn cef_string_multimap_enumerate(smm: *mut cef_string_multimap_t, if smm.is_null() { return 0; } let v = string_multimap_to_treemap(smm); slice_to_str((*key).str as *const u8, (*key).length as usize, |result| { - match (*v).get(&String::from_str(result)) { + match (*v).get(result) { Some(s) => { if (*s).len() <= index as usize { return 0;