matrix-sdk: Fix some new clippy warnings

master
Damir Jelić 2021-02-12 12:59:53 +01:00
parent 2e7f862f9c
commit 2811c490a0
3 changed files with 14 additions and 18 deletions

View File

@ -1,4 +1,4 @@
use std::{convert::TryFrom, fmt::Debug, io, sync::Arc};
use std::{convert::TryFrom, fmt::Debug, sync::Arc};
use futures::executor::block_on;
use serde::Serialize;
@ -388,7 +388,7 @@ impl Inspector {
}
}
fn main() -> io::Result<()> {
fn main() {
let argparse = Argparse::new("state-inspector")
.global_setting(ArgParseSettings::DisableVersion)
.global_setting(ArgParseSettings::VersionlessSubcommands)
@ -430,6 +430,4 @@ fn main() -> io::Result<()> {
} else {
block_on(inspector.run(matches));
}
Ok(())
}

View File

@ -495,20 +495,17 @@ impl BaseClient {
},
#[cfg(feature = "encryption")]
AnySyncRoomEvent::Message(message) => {
if let AnySyncMessageEvent::RoomEncrypted(encrypted) = message {
if let Some(olm) = self.olm_machine().await {
if let Ok(decrypted) =
olm.decrypt_room_event(encrypted, room_id).await
{
match decrypted.deserialize() {
Ok(decrypted) => e = decrypted,
Err(e) => {
warn!(
"Error deserializing a decrypted event {:?} ",
e
)
}
AnySyncRoomEvent::Message(AnySyncMessageEvent::RoomEncrypted(
encrypted,
)) => {
if let Some(olm) = self.olm_machine().await {
if let Ok(decrypted) =
olm.decrypt_room_event(encrypted, room_id).await
{
match decrypted.deserialize() {
Ok(decrypted) => e = decrypted,
Err(e) => {
warn!("Error deserializing a decrypted event {:?} ", e)
}
}
}

View File

@ -134,6 +134,7 @@ impl VerificationRequest {
self.inner.lock().unwrap().accept()
}
#[allow(clippy::unnecessary_wraps)]
pub(crate) fn receive_ready(
&self,
sender: &UserId,