Auto merge of #9123 - karyon:clippy_cleanup, r=Manishearth

Fix a bunch of clippy lints

This fixes about 130 clippy lints. Let me know if i should split up the commit.

I wasn't sure about some of the changes, especially map_or instead of map(...).unwrap_or(...) and if let instead of single arm match were not always a strict improvement in my opinion, but i'll leave that decision to the reviewer :)

There are about 150 lints left which i thought were clippy bugs or i didn't know how to fix.

cc @Manishearth

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9123)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-01-03 09:16:34 +05:30
commit 9da739acef
58 changed files with 281 additions and 356 deletions

View file

@ -70,8 +70,7 @@ impl LayoutHTMLTextAreaElementHelpers for LayoutJS<HTMLTextAreaElement> {
unsafe {
(*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &atom!("cols"))
.map(AttrValue::as_uint)
.unwrap_or(DEFAULT_COLS)
.map_or(DEFAULT_COLS, AttrValue::as_uint)
}
}
@ -80,8 +79,7 @@ impl LayoutHTMLTextAreaElementHelpers for LayoutJS<HTMLTextAreaElement> {
unsafe {
(*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &atom!("rows"))
.map(AttrValue::as_uint)
.unwrap_or(DEFAULT_ROWS)
.map_or(DEFAULT_ROWS, AttrValue::as_uint)
}
}
}