Fix clippy warnings
parent
1fd1570e07
commit
0bd438e617
|
@ -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()
|
||||
|
|
|
@ -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>> = {
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue