Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasavru authored and maxhbooth committed Mar 12, 2024
1 parent b767ed1 commit 65f1d3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/server/smithay_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,10 @@ pub fn set_xdg_toplevel_attributes(
// Be careful about not moving objects out of
// toplevel_attributes here.
toplevel_state.parent = toplevel_attributes.parent.as_ref().map(WlSurfaceId::new);
toplevel_state.title = toplevel_attributes.title.clone();
toplevel_state.app_id = toplevel_attributes.app_id.clone();
toplevel_state.title.clone_from(&toplevel_attributes.title);
toplevel_state
.app_id
.clone_from(&toplevel_attributes.app_id);

// TODO: decoration mode are in wayland::shell::xdg::ToplevelState. See also
// TODO in server_handlers::handle_toplevel.
Expand Down Expand Up @@ -769,7 +771,9 @@ pub fn commit_impl(
.location(loc!())?
.location(loc!())?;

surface_state_to_send.buffer = surface_state.buffer.clone();
surface_state_to_send
.buffer
.clone_from(&surface_state.buffer);
// surface_state.set_buffer (called above) sets buffer to
// Some(BufferAssignment::New(...)), so the 4 unwraps below should
// never fail.
Expand Down
4 changes: 2 additions & 2 deletions src/xwayland_xdg_shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl XWaylandSurface {
match wayland_window_type {
WaylandWindowType::Toplevel => {
debug!("creating xdg_toplevel for {self:?}");
self.parent = parent_if_toplevel.clone();
self.parent.clone_from(&parent_if_toplevel);
XWaylandXdgToplevel::set_role(
self,
parent_if_toplevel.and_then(|p| p.for_toplevel).as_ref(),
Expand Down Expand Up @@ -187,7 +187,7 @@ impl XWaylandSurface {
},
WaylandWindowType::Popup => {
debug!("creating xdg_popup for {self:?}");
self.parent = parent_if_popup.clone();
self.parent.clone_from(&parent_if_popup);
XWaylandXdgPopup::set_role(
self,
&parent_if_popup.unwrap().for_popup,
Expand Down

0 comments on commit 65f1d3a

Please sign in to comment.