Use let-else in some more places
This commit is contained in:
parent
4e6e413f3d
commit
a522b09f79
2 changed files with 3 additions and 7 deletions
|
|
@ -181,9 +181,8 @@ impl Ui {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle events (in batches)
|
// Handle events (in batches)
|
||||||
let mut event = match event_rx.recv().await {
|
let Some(mut event) = event_rx.recv().await else {
|
||||||
Some(event) => event,
|
return Ok(());
|
||||||
None => return Ok(()),
|
|
||||||
};
|
};
|
||||||
let end_time = Instant::now() + EVENT_PROCESSING_TIME;
|
let end_time = Instant::now() + EVENT_PROCESSING_TIME;
|
||||||
loop {
|
loop {
|
||||||
|
|
|
||||||
|
|
@ -532,10 +532,7 @@ impl EuphRoom {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_event(&mut self, event: Event) -> bool {
|
pub async fn handle_event(&mut self, event: Event) -> bool {
|
||||||
let room = match &self.room {
|
let Some(room) = &self.room else { return false };
|
||||||
None => return false,
|
|
||||||
Some(room) => room,
|
|
||||||
};
|
|
||||||
|
|
||||||
if event.config().name != room.instance().config().name {
|
if event.config().name != room.instance().config().name {
|
||||||
// If we allowed names other than the current one, old instances
|
// If we allowed names other than the current one, old instances
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue