Skip to content

Commit

Permalink
clippy pass
Browse files Browse the repository at this point in the history
  • Loading branch information
fengalin authored and bilelmoussaoui committed Apr 13, 2021
1 parent 4b2f7e9 commit bb81ed4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion book/listings/gobject_properties/4/custom_button/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl WidgetImpl for CustomButton {}
// Trait shared by all buttons
impl ButtonImpl for CustomButton {
fn clicked(&self, button: &Self::Type) {
let incremented_number = self.number.borrow().clone() + 1;
let incremented_number = *self.number.borrow() + 1;
button.set_property("number", &incremented_number).unwrap();
button.set_label(&self.number.borrow().to_string())
}
Expand Down
6 changes: 6 additions & 0 deletions book/listings/gobject_properties/4/custom_button/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ impl CustomButton {
Object::new(&[]).expect("Failed to create Button")
}
}

impl Default for CustomButton {
fn default() -> Self {
CustomButton::new()
}
}
6 changes: 6 additions & 0 deletions book/listings/gobject_signals/3/custom_button/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ impl CustomButton {
glib::Object::new(&[]).expect("Failed to create Button")
}
}

impl Default for CustomButton {
fn default() -> Self {
CustomButton::new()
}
}
6 changes: 6 additions & 0 deletions book/listings/gobject_subclassing/1/custom_button/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ impl CustomButton {
glib::Object::new(&[("label", &label)]).expect("Failed to create Button")
}
}

impl Default for CustomButton {
fn default() -> Self {
CustomButton::new()
}
}
6 changes: 6 additions & 0 deletions book/listings/gobject_subclassing/2/custom_button/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ impl CustomButton {
glib::Object::new(&[]).expect("Failed to create Button")
}
}

impl Default for CustomButton {
fn default() -> Self {
CustomButton::new()
}
}

0 comments on commit bb81ed4

Please sign in to comment.