Fix clippy warnings
parent
1fd1570e07
commit
0bd438e617
|
@ -963,7 +963,7 @@ impl Client {
|
||||||
let event = event.clone().into();
|
let event = event.clone().into();
|
||||||
|
|
||||||
if let AnySyncMessageEvent::RoomEncrypted(e) = event {
|
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
|
let event = decrypted
|
||||||
.event
|
.event
|
||||||
.deserialize()
|
.deserialize()
|
||||||
|
|
|
@ -461,9 +461,9 @@ impl Joined {
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
let mut reader = AttachmentEncryptor::new(reader);
|
let mut reader = AttachmentEncryptor::new(reader);
|
||||||
#[cfg(feature = "encryption")]
|
#[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")]
|
#[cfg(feature = "encryption")]
|
||||||
let keys: Option<Box<EncryptedFile>> = {
|
let keys: Option<Box<EncryptedFile>> = {
|
||||||
|
|
|
@ -484,7 +484,7 @@ impl VerificationMachine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(Verification::QrV1(qr)) => {
|
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 {
|
if let Some(c) = cancellation {
|
||||||
self.verifications.add_request(c.into())
|
self.verifications.add_request(c.into())
|
||||||
|
|
|
@ -177,7 +177,7 @@ pub struct CancelInfo {
|
||||||
impl CancelInfo {
|
impl CancelInfo {
|
||||||
/// Get the human readable reason of the cancellation.
|
/// Get the human readable reason of the cancellation.
|
||||||
pub fn reason(&self) -> &'static str {
|
pub fn reason(&self) -> &'static str {
|
||||||
&self.reason
|
self.reason
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the `CancelCode` that cancelled this verification.
|
/// Get the `CancelCode` that cancelled this verification.
|
||||||
|
|
|
@ -389,7 +389,7 @@ impl VerificationRequest {
|
||||||
|
|
||||||
inner.accept(methods).map(|c| match c {
|
inner.accept(methods).map(|c| match c {
|
||||||
OutgoingContent::ToDevice(content) => {
|
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) => {
|
OutgoingContent::Room(room_id, content) => {
|
||||||
RoomMessageRequest { room_id, txn_id: Uuid::new_v4(), content }.into()
|
RoomMessageRequest { room_id, txn_id: Uuid::new_v4(), content }.into()
|
||||||
|
@ -433,14 +433,14 @@ impl VerificationRequest {
|
||||||
OutgoingContent::ToDevice(content) => {
|
OutgoingContent::ToDevice(content) => {
|
||||||
if send_to_everyone {
|
if send_to_everyone {
|
||||||
ToDeviceRequest::new_for_recipients(
|
ToDeviceRequest::new_for_recipients(
|
||||||
&self.other_user(),
|
self.other_user(),
|
||||||
self.recipient_devices.to_vec(),
|
self.recipient_devices.to_vec(),
|
||||||
content,
|
content,
|
||||||
Uuid::new_v4(),
|
Uuid::new_v4(),
|
||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
} else {
|
} else {
|
||||||
ToDeviceRequest::new(&self.other_user(), other_device, content).into()
|
ToDeviceRequest::new(self.other_user(), other_device, content).into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OutgoingContent::Room(room_id, content) => {
|
OutgoingContent::Room(room_id, content) => {
|
||||||
|
@ -621,7 +621,7 @@ impl VerificationRequest {
|
||||||
|
|
||||||
let request = match content {
|
let request = match content {
|
||||||
OutgoingContent::ToDevice(content) => ToDeviceRequest::new(
|
OutgoingContent::ToDevice(content) => ToDeviceRequest::new(
|
||||||
&self.other_user(),
|
self.other_user(),
|
||||||
inner.other_device_id(),
|
inner.other_device_id(),
|
||||||
content,
|
content,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue