Use let-else in some more places

This commit is contained in:
Joscha 2024-01-02 15:43:47 +01:00
parent 4e6e413f3d
commit a522b09f79
2 changed files with 3 additions and 7 deletions

View file

@ -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 {

View file

@ -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