From 1ded2c74a2f3e603402d32a2db64b5ba78307a9b Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 16 Apr 2026 18:27:21 +0200 Subject: [PATCH] ci: update Rust to 1.95.0 --- .github/workflows/ci.yml | 2 +- src/chat.rs | 4 ---- src/contact.rs | 1 - src/events/chatlist_events.rs | 10 +++------- src/html.rs | 2 -- src/message.rs | 2 -- src/mimefactory.rs | 1 - src/mimeparser.rs | 1 - src/net/proxy.rs | 2 -- src/plaintext.rs | 1 - src/qr.rs | 1 - src/qr_code_generator.rs | 2 -- src/simplify.rs | 1 - src/tools.rs | 1 - 14 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 964ab89c0..850f22c6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ permissions: {} env: RUSTFLAGS: -Dwarnings - RUST_VERSION: 1.94.0 + RUST_VERSION: 1.95.0 # Minimum Supported Rust Version MSRV: 1.88.0 diff --git a/src/chat.rs b/src/chat.rs index 51feae7e9..541e25dd5 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1188,7 +1188,6 @@ SELECT id, rfc724_mid, pre_rfc724_mid, timestamp, ?, 1 FROM msgs WHERE chat_id=? /// prefer plaintext emails. /// /// To get more verbose summary for a contact, including its key fingerprint, use [`Contact::get_encrinfo`]. - #[expect(clippy::arithmetic_side_effects)] pub async fn get_encryption_info(self, context: &Context) -> Result { let chat = Chat::load_from_db(context, self).await?; if !chat.is_encrypted(context).await? { @@ -1752,7 +1751,6 @@ impl Chat { /// /// If `update_msg_id` is set, that record is reused; /// if `update_msg_id` is None, a new record is created. - #[expect(clippy::arithmetic_side_effects)] async fn prepare_msg_raw( &mut self, context: &Context, @@ -3023,7 +3021,6 @@ pub async fn send_text_msg( } /// Sends chat members a request to edit the given message's text. -#[expect(clippy::arithmetic_side_effects)] pub async fn send_edit_request(context: &Context, msg_id: MsgId, new_text: String) -> Result<()> { let mut original_msg = Message::load_from_db(context, msg_id).await?; ensure!( @@ -4612,7 +4609,6 @@ pub async fn save_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> { /// the copy contains a reference to the original message /// as well as to the original chat in case the original message gets deleted. /// Returns data needed to add a `SaveMessage` sync item. -#[expect(clippy::arithmetic_side_effects)] pub(crate) async fn save_copy_in_self_talk( context: &Context, src_msg_id: MsgId, diff --git a/src/contact.rs b/src/contact.rs index 4b750803f..976fedd3e 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -2068,7 +2068,6 @@ pub(crate) async fn mark_contact_id_as_verified( Ok(()) } -#[expect(clippy::arithmetic_side_effects)] fn cat_fingerprint(ret: &mut String, name: &str, addr: &str, fingerprint: &str) { *ret += &format!("\n\n{name} ({addr}):\n{fingerprint}"); } diff --git a/src/events/chatlist_events.rs b/src/events/chatlist_events.rs index 50ee06828..540e6a6e0 100644 --- a/src/events/chatlist_events.rs +++ b/src/events/chatlist_events.rs @@ -89,13 +89,9 @@ mod test_chatlist_events { .get_matching(|evt| match evt { EventType::ChatlistItemChanged { chat_id: Some(ev_chat_id), - } => { - if ev_chat_id == &chat_id { - first_event_is_item.store(true, Ordering::Relaxed); - true - } else { - false - } + } if ev_chat_id == &chat_id => { + first_event_is_item.store(true, Ordering::Relaxed); + true } EventType::ChatlistChanged => true, _ => false, diff --git a/src/html.rs b/src/html.rs index a28d27055..dd7ada62e 100644 --- a/src/html.rs +++ b/src/html.rs @@ -86,7 +86,6 @@ impl HtmlMsgParser { /// Function takes a raw mime-message string, /// searches for the main-text part /// and returns that as parser.html - #[expect(clippy::arithmetic_side_effects)] pub fn from_bytes<'a>( context: &Context, rawmime: &'a [u8], @@ -120,7 +119,6 @@ impl HtmlMsgParser { /// Usually, there is at most one plain-text and one HTML-text part, /// multiple plain-text parts might be used for mailinglist-footers, /// therefore we use the first one. - #[expect(clippy::arithmetic_side_effects)] fn collect_texts_recursive<'a>( &'a mut self, context: &'a Context, diff --git a/src/message.rs b/src/message.rs index d292f5224..d40de7299 100644 --- a/src/message.rs +++ b/src/message.rs @@ -199,7 +199,6 @@ SELECT ?1, rfc724_mid, pre_rfc724_mid, timestamp, ?, ? FROM msgs WHERE id=?1 } /// Returns detailed message information in a multi-line text form. - #[expect(clippy::arithmetic_side_effects)] pub async fn get_info(self, context: &Context) -> Result { let msg = Message::load_from_db(context, self).await?; @@ -825,7 +824,6 @@ impl Message { /// /// Currently this includes `additional_text`, but this may change in future, when the UIs show /// the necessary info themselves. - #[expect(clippy::arithmetic_side_effects)] pub fn get_text(&self) -> String { self.text.clone() + &self.additional_text } diff --git a/src/mimefactory.rs b/src/mimefactory.rs index 91d682be8..1d643e842 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -1887,7 +1887,6 @@ impl MimeFactory { } /// Render an MDN - #[expect(clippy::arithmetic_side_effects)] fn render_mdn(&mut self) -> Result> { // RFC 6522, this also requires the `report-type` parameter which is equal // to the MIME subtype of the second body part of the multipart/report diff --git a/src/mimeparser.rs b/src/mimeparser.rs index e57c31e10..442232412 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -269,7 +269,6 @@ impl MimeMessage { /// /// This method has some side-effects, /// such as saving blobs and saving found public keys to the database. - #[expect(clippy::arithmetic_side_effects)] pub(crate) async fn from_bytes(context: &Context, body: &[u8]) -> Result { let mail = mailparse::parse_mail(body)?; diff --git a/src/net/proxy.rs b/src/net/proxy.rs index a88b15b0b..c2e5a9429 100644 --- a/src/net/proxy.rs +++ b/src/net/proxy.rs @@ -171,7 +171,6 @@ pub enum ProxyConfig { } /// Constructs HTTP/1.1 `CONNECT` request for HTTP(S) proxy. -#[expect(clippy::arithmetic_side_effects)] fn http_connect_request(host: &str, port: u16, auth: Option<(&str, &str)>) -> String { // According to // clients MUST send `Host:` header in HTTP/1.1 requests, @@ -320,7 +319,6 @@ impl ProxyConfig { /// config into `proxy_url` if `proxy_url` is unset or empty. /// /// Unsets `socks5_host`, `socks5_port`, `socks5_user` and `socks5_password` in any case. - #[expect(clippy::arithmetic_side_effects)] async fn migrate_socks_config(sql: &Sql) -> Result<()> { if sql.get_raw_config("proxy_url").await?.is_none() { // Load legacy SOCKS5 settings. diff --git a/src/plaintext.rs b/src/plaintext.rs index f10bd9d72..349b02021 100644 --- a/src/plaintext.rs +++ b/src/plaintext.rs @@ -24,7 +24,6 @@ pub struct PlainText { impl PlainText { /// Convert plain text to HTML. /// The function handles quotes, links, fixed and floating text paragraphs. - #[expect(clippy::arithmetic_side_effects)] pub fn to_html(&self) -> String { static LINKIFY_MAIL_RE: LazyLock = LazyLock::new(|| regex::Regex::new(r"\b([\w.\-+]+@[\w.\-]+)\b").unwrap()); diff --git a/src/qr.rs b/src/qr.rs index 1c8a2f60d..c204c194c 100644 --- a/src/qr.rs +++ b/src/qr.rs @@ -714,7 +714,6 @@ fn decode_account(qr: &str) -> Result { } /// scheme: `https://t.me/socks?server=foo&port=123` or `https://t.me/socks?server=1.2.3.4&port=123` -#[expect(clippy::arithmetic_side_effects)] fn decode_tg_socks_proxy(_context: &Context, qr: &str) -> Result { let url = url::Url::parse(qr).context("Invalid t.me/socks url")?; diff --git a/src/qr_code_generator.rs b/src/qr_code_generator.rs index 58f9c73ac..64aa996db 100644 --- a/src/qr_code_generator.rs +++ b/src/qr_code_generator.rs @@ -15,7 +15,6 @@ use crate::securejoin; use crate::stock_str::{self, backup_transfer_qr}; /// Create a QR code from any input data. -#[expect(clippy::arithmetic_side_effects)] pub fn create_qr_svg(qrcode_content: &str) -> Result { let all_size = 512.0; let qr_code_size = 416.0; @@ -176,7 +175,6 @@ async fn self_info(context: &Context) -> Result<(Option>, String, String Ok((avatar, displayname, addr, color)) } -#[expect(clippy::arithmetic_side_effects)] fn inner_generate_secure_join_qr_code( qrcode_description: &str, qrcode_content: &str, diff --git a/src/simplify.rs b/src/simplify.rs index 0e3c70865..65c5f553e 100644 --- a/src/simplify.rs +++ b/src/simplify.rs @@ -9,7 +9,6 @@ use crate::tools::IsNoneOrEmpty; /// This escapes a bit more than actually needed by delta (e.g. also lines as "-- footer"), /// but for non-delta-compatibility, that seems to be better. /// (to be only compatible with delta, only "[\r\n|\n]-- {0,2}[\r\n|\n]" needs to be replaced) -#[expect(clippy::arithmetic_side_effects)] pub fn escape_message_footer_marks(text: &str) -> String { if let Some(text) = text.strip_prefix("--") { "-\u{200B}-".to_string() + &text.replace("\n--", "\n-\u{200B}-") diff --git a/src/tools.rs b/src/tools.rs index a7fd5c1fd..839b993b8 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -687,7 +687,6 @@ fn extract_address_from_receive_header<'a>(header: &'a str, start: &str) -> Opti }) } -#[expect(clippy::arithmetic_side_effects)] pub(crate) fn parse_receive_header(header: &str) -> String { let header = header.replace(&['\r', '\n'][..], ""); let mut hop_info = String::from("Hop: ");