matrix-sdk: Fix some new clippy warnings
This commit is contained in:
parent
2e7f862f9c
commit
2811c490a0
3 changed files with 14 additions and 18 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue