Refactor double let else blocks to use as_mut

This commit is contained in:
En-En 2025-06-23 12:47:20 +00:00 committed by Supreeeme
parent 8dc4538662
commit 117af56a83
2 changed files with 15 additions and 27 deletions

View file

@ -727,19 +727,16 @@ impl<C: XConnection> ServerState<C> {
}
pub fn reconfigure_window(&mut self, event: x::ConfigureNotifyEvent) {
let Some(data) = self
let Some((mut win, data)) = self
.windows
.get(&event.window())
.copied()
.and_then(|id| self.world.entity(id).ok())
.and_then(|d| Some((d.get::<&mut WindowData>()?, d)))
else {
debug!("not reconfiguring unknown window {:?}", event.window());
return;
};
let Some(mut win) = data.get::<&mut WindowData>() else {
debug!("not reconfiguring unknown window {:?}", event.window());
return;
};
let dims = WindowDims {
x: event.x(),