diff --git a/src/blob.rs b/src/blob.rs index 3f67c2b52..19e09af29 100644 --- a/src/blob.rs +++ b/src/blob.rs @@ -740,7 +740,6 @@ fn add_white_bg(img: &mut DynamicImage) { #[cfg(test)] mod tests { use fs::File; - use image::Pixel; use super::*; use crate::chat::{self, create_group_chat, ProtectionStatus}; diff --git a/src/chat.rs b/src/chat.rs index e71427c24..edb7d8209 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1439,7 +1439,7 @@ impl rusqlite::types::ToSql for ChatId { impl rusqlite::types::FromSql for ChatId { fn column_result(value: rusqlite::types::ValueRef) -> rusqlite::types::FromSqlResult { i64::column_result(value).and_then(|val| { - if 0 <= val && val <= i64::from(std::u32::MAX) { + if 0 <= val && val <= i64::from(u32::MAX) { Ok(ChatId::new(val as u32)) } else { Err(rusqlite::types::FromSqlError::OutOfRange(val)) diff --git a/src/message.rs b/src/message.rs index 4bfad2d56..4a4eaa621 100644 --- a/src/message.rs +++ b/src/message.rs @@ -362,7 +362,7 @@ impl rusqlite::types::FromSql for MsgId { fn column_result(value: rusqlite::types::ValueRef) -> rusqlite::types::FromSqlResult { // Would be nice if we could use match here, but alas. i64::column_result(value).and_then(|val| { - if 0 <= val && val <= i64::from(std::u32::MAX) { + if 0 <= val && val <= i64::from(u32::MAX) { Ok(MsgId::new(val as u32)) } else { Err(rusqlite::types::FromSqlError::OutOfRange(val)) diff --git a/src/mimefactory.rs b/src/mimefactory.rs index 2ac1f02bc..265bc4d68 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -1586,9 +1586,8 @@ mod tests { use std::str; use super::*; - use crate::chat::ChatId; use crate::chat::{ - self, add_contact_to_chat, create_group_chat, remove_contact_from_chat, send_text_msg, + add_contact_to_chat, create_group_chat, remove_contact_from_chat, send_text_msg, ChatId, ProtectionStatus, }; use crate::chatlist::Chatlist; diff --git a/src/receive_imf/tests.rs b/src/receive_imf/tests.rs index 781b195b7..8ea32a2a6 100644 --- a/src/receive_imf/tests.rs +++ b/src/receive_imf/tests.rs @@ -9,7 +9,7 @@ use crate::chat::{ ChatVisibility, }; use crate::chatlist::Chatlist; -use crate::constants::{ShowEmails, DC_GCL_FOR_FORWARDING, DC_GCL_NO_SPECIALS}; +use crate::constants::{DC_GCL_FOR_FORWARDING, DC_GCL_NO_SPECIALS}; use crate::download::MIN_DOWNLOAD_LIMIT; use crate::imap::prefetch_should_download; use crate::imex::{imex, ImexMode}; diff --git a/src/test_utils.rs b/src/test_utils.rs index af6888be2..900fd48dd 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -1056,8 +1056,10 @@ pub(crate) async fn mark_as_verified(this: &TestContext, other: &TestContext) { 0, ); - peerstate.verified_key = peerstate.public_key.clone(); - peerstate.verified_key_fingerprint = peerstate.public_key_fingerprint.clone(); + peerstate.verified_key.clone_from(&peerstate.public_key); + peerstate + .verified_key_fingerprint + .clone_from(&peerstate.public_key_fingerprint); peerstate.backward_verified_key_id = Some(this.get_config_i64(Config::KeyId).await.unwrap()); peerstate.save_to_db(&this.sql).await.unwrap();