Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
wez authored Sep 14, 2024
1 parent efc9a58 commit 7e1cdc6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions window/src/os/wayland/copy_and_paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,10 @@ impl CopyAndPaste {
impl WaylandState {
pub(super) fn resolve_copy_and_paste(&mut self) -> Option<Arc<Mutex<CopyAndPaste>>> {
let active_surface_id = self.active_surface_id.borrow();
if let Some(active_surface_id) = active_surface_id.as_ref() {
if let Some(pending) = self.surface_to_pending.get(&active_surface_id) {
Some(Arc::clone(&pending.lock().unwrap().copy_and_paste))
} else {
None
}
let active_surface_id = self.active_surface_id.borrow();
let active_surface_id = active_surface_id.as_ref()?;
let pending = self.surface_to_pending.get(&active_surface_id)?;
Some(Arc::clone(&pending.lock().unwrap().copy_and_paste))
} else {
None
}
Expand Down

0 comments on commit 7e1cdc6

Please sign in to comment.