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

@ -599,7 +599,7 @@ impl VirtualMethods for HTMLInputElement {
&atom!("value") if !self.value_changed.get() => {
let value = mutation.new_value(attr).map(|value| (**value).to_owned());
self.textinput.borrow_mut().set_content(
value.map(DOMString::from).unwrap_or(DOMString::from("")));
value.map_or(DOMString::new(), DOMString::from));
},
&atom!("name") if self.input_type.get() == InputType::InputRadio => {
self.radio_group_updated(
@ -666,9 +666,8 @@ impl VirtualMethods for HTMLInputElement {
}
if event.type_() == atom!("click") && !event.DefaultPrevented() {
match self.input_type.get() {
InputType::InputRadio => self.update_checked_state(true, true),
_ => {}
if let InputType::InputRadio = self.input_type.get() {
self.update_checked_state(true, true);
}
// TODO: Dispatch events for non activatable inputs