Fix clippy warnings

master
stoically 2021-08-05 22:48:05 +02:00
parent 1fd1570e07
commit 0bd438e617
5 changed files with 9 additions and 9 deletions

View File

@ -963,7 +963,7 @@ impl Client {
let event = event.clone().into();
if let AnySyncMessageEvent::RoomEncrypted(e) = event {
if let Ok(decrypted) = machine.decrypt_room_event(&e, &room_id).await {
if let Ok(decrypted) = machine.decrypt_room_event(&e, room_id).await {
let event = decrypted
.event
.deserialize()

View File

@ -461,9 +461,9 @@ impl Joined {
#[cfg(feature = "encryption")]
let mut reader = AttachmentEncryptor::new(reader);
#[cfg(feature = "encryption")]
let content_type = mime::APPLICATION_OCTET_STREAM;
let content_type = &mime::APPLICATION_OCTET_STREAM;
let response = self.client.upload(&content_type, &mut reader).await?;
let response = self.client.upload(content_type, &mut reader).await?;
#[cfg(feature = "encryption")]
let keys: Option<Box<EncryptedFile>> = {

View File

@ -484,7 +484,7 @@ impl VerificationMachine {
}
}
Some(Verification::QrV1(qr)) => {
let (cancellation, request) = qr.receive_done(&c).await?;
let (cancellation, request) = qr.receive_done(c).await?;
if let Some(c) = cancellation {
self.verifications.add_request(c.into())

View File

@ -177,7 +177,7 @@ pub struct CancelInfo {
impl CancelInfo {
/// Get the human readable reason of the cancellation.
pub fn reason(&self) -> &'static str {
&self.reason
self.reason
}
/// Get the `CancelCode` that cancelled this verification.

View File

@ -389,7 +389,7 @@ impl VerificationRequest {
inner.accept(methods).map(|c| match c {
OutgoingContent::ToDevice(content) => {
ToDeviceRequest::new(&self.other_user(), inner.other_device_id(), content).into()
ToDeviceRequest::new(self.other_user(), inner.other_device_id(), content).into()
}
OutgoingContent::Room(room_id, content) => {
RoomMessageRequest { room_id, txn_id: Uuid::new_v4(), content }.into()
@ -433,14 +433,14 @@ impl VerificationRequest {
OutgoingContent::ToDevice(content) => {
if send_to_everyone {
ToDeviceRequest::new_for_recipients(
&self.other_user(),
self.other_user(),
self.recipient_devices.to_vec(),
content,
Uuid::new_v4(),
)
.into()
} else {
ToDeviceRequest::new(&self.other_user(), other_device, content).into()
ToDeviceRequest::new(self.other_user(), other_device, content).into()
}
}
OutgoingContent::Room(room_id, content) => {
@ -621,7 +621,7 @@ impl VerificationRequest {
let request = match content {
OutgoingContent::ToDevice(content) => ToDeviceRequest::new(
&self.other_user(),
self.other_user(),
inner.other_device_id(),
content,
)