diff --git a/src/servo/dom/bindings/codegen/CodegenRust.py b/src/servo/dom/bindings/codegen/CodegenRust.py index 675557ba556..7502d112aa9 100644 --- a/src/servo/dom/bindings/codegen/CodegenRust.py +++ b/src/servo/dom/bindings/codegen/CodegenRust.py @@ -2138,7 +2138,7 @@ class CGImports(CGWrapper): # TODO imports to cover descriptors, etc. def _useString(imports): - return '#[allow(unused_imports,unused_variable,unused_unsafe)];' + ''.join(['use %s;\n' % i for i in imports]) + '\n' + return '#[allow(unused_imports,unused_variable,unused_unsafe,unused_mut)];' + ''.join(['use %s;\n' % i for i in imports]) + '\n' CGWrapper.__init__(self, child, declarePre=_useString(sorted(declareImports))) diff --git a/src/servo/dom/bindings/element.rs b/src/servo/dom/bindings/element.rs index 0e171de0cd1..4f568f15b5a 100644 --- a/src/servo/dom/bindings/element.rs +++ b/src/servo/dom/bindings/element.rs @@ -174,7 +174,7 @@ extern fn getBoundingClientRect(cx: *JSContext, _argc: c_uint, vp: *JSVal) -> JS extern fn setAttribute(cx: *JSContext, argc: c_uint, vp: *JSVal) -> JSBool { unsafe { let obj = JS_THIS_OBJECT(cx, vp); - let mut node = unwrap(obj); + let node = unwrap(obj); if (argc < 2) { return 0; //XXXjdm throw exception @@ -212,7 +212,7 @@ extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa return 0; } - let mut node = unwrap(obj); + let node = unwrap(obj); let width = match node.type_id() { ElementNodeTypeId(HTMLImageElementTypeId) => { let content = task_from_context(cx); @@ -245,7 +245,7 @@ extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa return 0; } - let mut node = unwrap(obj); + let node = unwrap(obj); match node.type_id() { ElementNodeTypeId(HTMLImageElementTypeId) => { do node.as_mut_element |elem| { @@ -269,7 +269,7 @@ extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut JSVal) -> JSBool { return 0; } - let mut node = unwrap(obj); + let node = unwrap(obj); do node.with_imm_element |elem| { let s = str(copy elem.tag_name); *vp = domstring_to_jsval(cx, &s);