Remove unused mutable warning spam from generated code.

This commit is contained in:
Josh Matthews 2013-05-08 15:43:33 -04:00
parent af2db0cf68
commit c9f46e6167
2 changed files with 5 additions and 5 deletions

View file

@ -2138,7 +2138,7 @@ class CGImports(CGWrapper):
# TODO imports to cover descriptors, etc. # TODO imports to cover descriptors, etc.
def _useString(imports): 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, CGWrapper.__init__(self, child,
declarePre=_useString(sorted(declareImports))) declarePre=_useString(sorted(declareImports)))

View file

@ -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 { extern fn setAttribute(cx: *JSContext, argc: c_uint, vp: *JSVal) -> JSBool {
unsafe { unsafe {
let obj = JS_THIS_OBJECT(cx, vp); let obj = JS_THIS_OBJECT(cx, vp);
let mut node = unwrap(obj); let node = unwrap(obj);
if (argc < 2) { if (argc < 2) {
return 0; //XXXjdm throw exception return 0; //XXXjdm throw exception
@ -212,7 +212,7 @@ extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa
return 0; return 0;
} }
let mut node = unwrap(obj); let node = unwrap(obj);
let width = match node.type_id() { let width = match node.type_id() {
ElementNodeTypeId(HTMLImageElementTypeId) => { ElementNodeTypeId(HTMLImageElementTypeId) => {
let content = task_from_context(cx); let content = task_from_context(cx);
@ -245,7 +245,7 @@ extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa
return 0; return 0;
} }
let mut node = unwrap(obj); let node = unwrap(obj);
match node.type_id() { match node.type_id() {
ElementNodeTypeId(HTMLImageElementTypeId) => { ElementNodeTypeId(HTMLImageElementTypeId) => {
do node.as_mut_element |elem| { do node.as_mut_element |elem| {
@ -269,7 +269,7 @@ extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut JSVal) -> JSBool {
return 0; return 0;
} }
let mut node = unwrap(obj); let node = unwrap(obj);
do node.with_imm_element |elem| { do node.with_imm_element |elem| {
let s = str(copy elem.tag_name); let s = str(copy elem.tag_name);
*vp = domstring_to_jsval(cx, &s); *vp = domstring_to_jsval(cx, &s);