Replaced DOMString constructor by conversion functions.

Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
This commit is contained in:
Alan Jeffrey 2015-11-11 16:26:53 -06:00
parent 736323a779
commit 84bde75b42
64 changed files with 256 additions and 254 deletions

View file

@ -119,10 +119,10 @@ impl WebGLRenderingContext {
Err(msg) => {
error!("Couldn't create WebGLRenderingContext: {}", msg);
let event = WebGLContextEvent::new(global,
DOMString("webglcontextcreationerror".to_owned()),
DOMString::from("webglcontextcreationerror"),
EventBubbles::DoesNotBubble,
EventCancelable::Cancelable,
DOMString(msg));
DOMString::from(msg));
event.upcast::<Event>().fire(canvas.upcast());
None
}
@ -631,7 +631,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
fn GetShaderInfoLog(&self, shader: Option<&WebGLShader>) -> Option<DOMString> {
if let Some(shader) = shader {
shader.info_log().map(DOMString)
shader.info_log().map(DOMString::from)
} else {
None
}