Refactor double let else blocks to use as_mut
This commit is contained in:
parent
8dc4538662
commit
117af56a83
2 changed files with 15 additions and 27 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue