Fix new clone_from Clippy lints
Browse files at this commit43aa2f95bed8450bc9246880eea2c0fdf1fc9eb3Parent: 5c0a1f43 changed files +7 -7
- src/input.rs +2 -2
- src/niri.rs +3 -3
- src/protocols/foreign_toplevel.rs +2 -2
src/input.rsmodified+2 -2
| @@ -845,7 +845,7 @@ impl State { | ||
| 845 | 845 | // Activate a new confinement if necessary. |
| 846 | 846 | self.niri.maybe_activate_pointer_constraint(new_pos, &under); |
| 847 | 847 | |
| 848 | - self.niri.pointer_focus = under.clone(); | |
| 848 | + self.niri.pointer_focus.clone_from(&under); | |
| 849 | 849 | let under = under.map(|u| u.surface); |
| 850 | 850 | |
| 851 | 851 | pointer.motion( |
| @@ -908,7 +908,7 @@ impl State { | ||
| 908 | 908 | |
| 909 | 909 | let under = self.niri.surface_under_and_global_space(pos); |
| 910 | 910 | self.niri.maybe_activate_pointer_constraint(pos, &under); |
| 911 | - self.niri.pointer_focus = under.clone(); | |
| 911 | + self.niri.pointer_focus.clone_from(&under); | |
| 912 | 912 | let under = under.map(|u| u.surface); |
| 913 | 913 | |
| 914 | 914 | pointer.motion( |
src/niri.rsmodified+3 -3
| @@ -374,7 +374,7 @@ impl State { | ||
| 374 | 374 | let under = self.niri.surface_under_and_global_space(location); |
| 375 | 375 | self.niri |
| 376 | 376 | .maybe_activate_pointer_constraint(location, &under); |
| 377 | - self.niri.pointer_focus = under.clone(); | |
| 377 | + self.niri.pointer_focus.clone_from(&under); | |
| 378 | 378 | let under = under.map(|u| u.surface); |
| 379 | 379 | |
| 380 | 380 | let pointer = &self.niri.seat.get_pointer().unwrap(); |
| @@ -433,7 +433,7 @@ impl State { | ||
| 433 | 433 | self.niri |
| 434 | 434 | .maybe_activate_pointer_constraint(location, &under); |
| 435 | 435 | |
| 436 | - self.niri.pointer_focus = under.clone(); | |
| 436 | + self.niri.pointer_focus.clone_from(&under); | |
| 437 | 437 | let under = under.map(|u| u.surface); |
| 438 | 438 | |
| 439 | 439 | pointer.motion( |
| @@ -588,7 +588,7 @@ impl State { | ||
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | - self.niri.keyboard_focus = focus.clone(); | |
| 591 | + self.niri.keyboard_focus.clone_from(&focus); | |
| 592 | 592 | keyboard.set_focus(self, focus, SERIAL_COUNTER.next_serial()); |
| 593 | 593 | |
| 594 | 594 | // FIXME: can be more granular. |
src/protocols/foreign_toplevel.rsmodified+2 -2
| @@ -172,7 +172,7 @@ fn refresh_toplevel( | ||
| 172 | 172 | |
| 173 | 173 | let mut new_title = None; |
| 174 | 174 | if data.title != role.title { |
| 175 | - data.title = role.title.clone(); | |
| 175 | + data.title.clone_from(&role.title); | |
| 176 | 176 | new_title = role.title.as_deref(); |
| 177 | 177 | |
| 178 | 178 | if new_title.is_none() { |
| @@ -182,7 +182,7 @@ fn refresh_toplevel( | ||
| 182 | 182 | |
| 183 | 183 | let mut new_app_id = None; |
| 184 | 184 | if data.app_id != role.app_id { |
| 185 | - data.app_id = role.app_id.clone(); | |
| 185 | + data.app_id.clone_from(&role.app_id); | |
| 186 | 186 | new_app_id = role.app_id.as_deref(); |
| 187 | 187 | |
| 188 | 188 | if new_app_id.is_none() { |