Skip to content

Commit

Permalink
update to use clone_from as per clippy suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tal committed Jun 3, 2024
1 parent 0cb1d1c commit 99383bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl Room {
if self.name == other.name {
return false;
}
self.name = other.name.clone();
self.name.clone_from(&other.name);
true
}

Expand Down Expand Up @@ -409,7 +409,7 @@ impl Light {
fn update(&mut self, other: &Self) -> bool {
let mut any_update = false;
if self.name != other.name {
self.name = other.name.clone();
self.name.clone_from(&other.name);
any_update = true;
}

Expand Down Expand Up @@ -1098,7 +1098,7 @@ impl LightStatus {
self.brightness = Some(brightness.clone());
}
self.emitting = other.emitting;
self.scene = other.scene.clone();
self.scene.clone_from(&other.scene);
if let Some(speed) = &other.speed {
self.speed = Some(speed.clone());
}
Expand Down

0 comments on commit 99383bf

Please sign in to comment.