diff --git a/src/client/sas.rs b/src/client/sas.rs index 570da8f..1ec96ec 100644 --- a/src/client/sas.rs +++ b/src/client/sas.rs @@ -98,13 +98,13 @@ impl super::Client { let Some(request) = client .encryption() .get_verification_request(&ev.sender, &ev.event_id) - .await else { + .await + else { tracing::warn!("creating verification request failed"); return; }; - let Ok(()) = request - .accept().await else { + let Ok(()) = request.accept().await else { tracing::warn!("can't accept verification request"); return; }; diff --git a/src/client/session.rs b/src/client/session.rs index a67a5c7..c0b7027 100644 --- a/src/client/session.rs +++ b/src/client/session.rs @@ -5,8 +5,8 @@ use std::os::unix::fs::PermissionsExt; use std::path::{Path, PathBuf}; use anyhow::bail; -use matrix_sdk::ruma::{OwnedUserId, UserId}; use matrix_sdk::matrix_auth::MatrixSession; +use matrix_sdk::ruma::{OwnedUserId, UserId}; use serde::{Deserialize, Serialize}; use tracing::error; @@ -65,7 +65,10 @@ fn persist_session_json(path: impl AsRef, session: &MatrixSession) -> anyh Ok(()) } -fn persist_session_keyring(user_id: impl AsRef, session: &MatrixSession) -> anyhow::Result<()> { +fn persist_session_keyring( + user_id: impl AsRef, + session: &MatrixSession, +) -> anyhow::Result<()> { let entry = keyring::Entry::new(CRATE_NAME, user_id.as_ref().as_str())?; entry.set_password(&serde_json::to_string(session)?)?; Ok(()) diff --git a/src/main.rs b/src/main.rs index b75135c..9b2b230 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,8 +173,8 @@ async fn on_room_message( receipt: bool, ) -> anyhow::Result<()> { match room.state() { - RoomState::Joined => {}, - _ => return Ok(()) + RoomState::Joined => {} + _ => return Ok(()), } let raw_json = event.clone().into_json(); @@ -310,25 +310,19 @@ async fn main() -> anyhow::Result<()> { println!("{}", serde_json::to_string(&events)?); } - Command::Rooms { room_id} => { + Command::Rooms { room_id } => { let out = match room_id { Some(room_id) => { let Some(room) = client.get_room(&room_id) else { bail!("no such room: {}", room_id); }; - let output = client - .query_room(room) - .await?; + let output = client.query_room(room).await?; serde_json::to_string(&output)? } None => { let mut output = vec![]; for room in client.rooms() { - output.push( - client - .query_room(room) - .await?, - ); + output.push(client.query_room(room).await?); } serde_json::to_string(&output)? }