Clean up the cast calls

This commit is contained in:
Anthony Ramine 2015-10-07 14:55:02 +02:00
parent 13ea3ac413
commit 68014af78e
66 changed files with 412 additions and 718 deletions

View file

@ -225,8 +225,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
// https://html.spec.whatwg.org/multipage/#dom-canvas-width
fn SetWidth(&self, width: u32) {
let elem = self.upcast::<Element>();
elem.set_uint_attribute(&atom!("width"), width)
self.upcast::<Element>().set_uint_attribute(&atom!("width"), width)
}
// https://html.spec.whatwg.org/multipage/#dom-canvas-height
@ -236,8 +235,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
// https://html.spec.whatwg.org/multipage/#dom-canvas-height
fn SetHeight(&self, height: u32) {
let elem = self.upcast::<Element>();
elem.set_uint_attribute(&atom!("height"), height)
self.upcast::<Element>().set_uint_attribute(&atom!("height"), height)
}
// https://html.spec.whatwg.org/multipage/#dom-canvas-getcontext
@ -264,8 +262,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
impl VirtualMethods for HTMLCanvasElement {
fn super_type(&self) -> Option<&VirtualMethods> {
let element: &HTMLElement = self.upcast::<HTMLElement>();
Some(element as &VirtualMethods)
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
}
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {