Run cargo fmt

This commit is contained in:
Joscha 2023-08-31 13:27:11 +02:00
parent 02bfd3ed3d
commit bd874e6212
4 changed files with 13 additions and 5 deletions

View file

@ -209,7 +209,9 @@ impl Room {
async fn on_packet(&mut self, packet: ParsedPacket) {
let room_name = &self.instance.config().room;
let Ok(data) = &packet.content else { return; };
let Ok(data) = &packet.content else {
return;
};
match data {
Data::BounceEvent(_) => {}
Data::DisconnectEvent(_) => {}

View file

@ -130,7 +130,9 @@ impl Ui {
lock: Weak<FairMutex<()>>,
) -> crossterm::Result<()> {
loop {
let Some(lock) = lock.upgrade() else { return Ok(()); };
let Some(lock) = lock.upgrade() else {
return Ok(());
};
let _guard = lock.lock();
if crossterm::event::poll(Self::POLL_DURATION)? {
let event = crossterm::event::read()?;

View file

@ -274,7 +274,9 @@ where
}
async fn root_id(&self, id: &TreeBlockId<M::Id>) -> Result<Option<M::Id>, S::Error> {
let Some(id) = id.any_id() else { return Ok(None); };
let Some(id) = id.any_id() else {
return Ok(None);
};
let path = self.store.path(id).await?;
Ok(Some(path.into_first()))
}
@ -480,7 +482,7 @@ where
async fn expand_bottom(&mut self) -> Result<(), Self::Error> {
let Some(bottom_root_id) = &self.bottom_root_id else {
self.blocks.end_bottom();
return Ok(())
return Ok(());
};
let next_root_id = self.store.next_root_id(bottom_root_id).await?;

View file

@ -554,7 +554,9 @@ impl Rooms {
pub async fn handle_euph_event(&mut self, event: Event) -> bool {
let room_name = event.config().room.clone();
let Some(room) = self.euph_rooms.get_mut(&room_name) else { return false; };
let Some(room) = self.euph_rooms.get_mut(&room_name) else {
return false;
};
let handled = room.handle_event(event).await;