mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-05 14:35:20 -04:00
matrix-sdk: Fix some new clippy warnings
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ impl VerificationRequest {
|
||||
self.inner.lock().unwrap().accept()
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
pub(crate) fn receive_ready(
|
||||
&self,
|
||||
sender: &UserId,
|
||||
|
||||
Reference in New Issue
Block a user