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)
|
||||
let mut event = match event_rx.recv().await {
|
||||
Some(event) => event,
|
||||
None => return Ok(()),
|
||||
let Some(mut event) = event_rx.recv().await else {
|
||||
return Ok(());
|
||||
};
|
||||
let end_time = Instant::now() + EVENT_PROCESSING_TIME;
|
||||
loop {
|
||||
|
|
|
|||
|
|
@ -532,10 +532,7 @@ impl EuphRoom {
|
|||
}
|
||||
|
||||
pub async fn handle_event(&mut self, event: Event) -> bool {
|
||||
let room = match &self.room {
|
||||
None => return false,
|
||||
Some(room) => room,
|
||||
};
|
||||
let Some(room) = &self.room else { return false };
|
||||
|
||||
if event.config().name != room.instance().config().name {
|
||||
// If we allowed names other than the current one, old instances
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue