diff --git a/Cargo.toml b/Cargo.toml index 8bd84200..97206253 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ repository = "https://gitlab.com/famedly/conduit" version = "0.10.0-alpha" # See also `rust-toolchain.toml` -rust-version = "1.79.0" +rust-version = "1.80.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/complement/Dockerfile b/complement/Dockerfile index e7cde40e..0bf0cfcd 100644 --- a/complement/Dockerfile +++ b/complement/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.79.0 +FROM rust:1.80.0 WORKDIR /workdir diff --git a/flake.nix b/flake.nix index f36f7e7a..4b50a7ec 100644 --- a/flake.nix +++ b/flake.nix @@ -59,7 +59,7 @@ file = ./rust-toolchain.toml; # See also `rust-toolchain.toml` - sha256 = "sha256-Ngiz76YP4HTY75GGdH2P+APE/DEIx2R/Dn+BwwOyzZU="; + sha256 = "sha256-6eN/GKzjVSjEhGO9FhWObkRFaE1Jf+uqMSdQnb8lcB4="; }; }); in diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 957c8f41..995b142b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -9,7 +9,7 @@ # If you're having trouble making the relevant changes, bug a maintainer. [toolchain] -channel = "1.79.0" +channel = "1.80.0" components = [ # For rust-analyzer "rust-src", diff --git a/src/api/client_server/account.rs b/src/api/client_server/account.rs index 47ccdc83..fd92f524 100644 --- a/src/api/client_server/account.rs +++ b/src/api/client_server/account.rs @@ -305,7 +305,7 @@ pub async fn register_route(body: Ruma) -> Result, ) -> Result { diff --git a/src/api/client_server/message.rs b/src/api/client_server/message.rs index fbdda077..c9a1b978 100644 --- a/src/api/client_server/message.rs +++ b/src/api/client_server/message.rs @@ -115,7 +115,7 @@ pub async fn send_message_event_route( /// Allows paginating through room history. /// /// - Only works if the user is joined (TODO: always allow, but only show events where the user was -/// joined, depending on history_visibility) +/// joined, depending on history_visibility) pub async fn get_message_events_route( body: Ruma, ) -> Result { diff --git a/src/api/client_server/sync.rs b/src/api/client_server/sync.rs index 57ceec3b..ec6c06b0 100644 --- a/src/api/client_server/sync.rs +++ b/src/api/client_server/sync.rs @@ -37,7 +37,7 @@ use tracing::{error, info}; /// Synchronize the client's state with the latest state on the server. /// /// - This endpoint takes a `since` parameter which should be the `next_batch` value from a -/// previous request for incremental syncs. +/// previous request for incremental syncs. /// /// Calling this endpoint without a `since` parameter returns: /// - Some of the most recent events of each timeline @@ -49,9 +49,9 @@ use tracing::{error, info}; /// For joined rooms: /// - Some of the most recent events of each timeline that happened after since /// - If user joined the room after since: All state events (unless lazy loading is activated) and -/// all device list updates in that room +/// all device list updates in that room /// - If the user was already in the room: A list of all events that are in the state now, but were -/// not in the state at `since` +/// not in the state at `since` /// - If the state we send contains a member event: Joined and invited member counts, heroes /// - Device list updates that happened after `since` /// - If there are events in the timeline we send or the user send updated his read mark: Notification counts @@ -65,7 +65,7 @@ use tracing::{error, info}; /// - If the user left after `since`: prev_batch token, empty state (TODO: subset of the state at the point of the leave) /// /// - Sync is handled in an async task, multiple requests from the same device with the same -/// `since` will be cached +/// `since` will be cached pub async fn sync_events_route( body: Ruma, ) -> Result> { diff --git a/src/api/client_server/user_directory.rs b/src/api/client_server/user_directory.rs index b4d11800..5447882e 100644 --- a/src/api/client_server/user_directory.rs +++ b/src/api/client_server/user_directory.rs @@ -12,7 +12,7 @@ use ruma::{ /// Searches all known users for a match. /// /// - Hides any local users that aren't in any public rooms (i.e. those that have the join rule set to public) -/// and don't share a room with the sender +/// and don't share a room with the sender pub async fn search_users_route( body: Ruma, ) -> Result { diff --git a/src/api/server_server.rs b/src/api/server_server.rs index f8afcf39..6715f756 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -696,7 +696,7 @@ pub async fn get_server_version_route( /// Gets the public signing keys of this server. /// /// - Matrix does not support invalidating public keys, so the key returned by this will be valid -/// forever. +/// forever. // Response type for this endpoint is Json because we need to calculate a signature for the response pub async fn get_server_keys_route() -> Result { let mut verify_keys: BTreeMap = BTreeMap::new(); @@ -743,7 +743,7 @@ pub async fn get_server_keys_route() -> Result { /// Gets the public signing keys of this server. /// /// - Matrix does not support invalidating public keys, so the key returned by this will be valid -/// forever. +/// forever. pub async fn get_server_keys_deprecated_route() -> impl IntoResponse { get_server_keys_route().await } diff --git a/src/database/key_value/rooms/edus/read_receipt.rs b/src/database/key_value/rooms/edus/read_receipt.rs index fa97ea34..9fc05f64 100644 --- a/src/database/key_value/rooms/edus/read_receipt.rs +++ b/src/database/key_value/rooms/edus/read_receipt.rs @@ -1,5 +1,3 @@ -use std::mem; - use ruma::{ events::receipt::ReceiptEvent, serde::Raw, CanonicalJsonObject, OwnedUserId, RoomId, UserId, }; @@ -73,12 +71,13 @@ impl service::rooms::edus::read_receipt::Data for KeyValueDatabase { .iter_from(&first_possible_edu, false) .take_while(move |(k, _)| k.starts_with(&prefix2)) .map(move |(k, v)| { - let count = utils::u64_from_bytes( - &k[prefix.len()..prefix.len() + mem::size_of::()], - ) - .map_err(|_| Error::bad_database("Invalid readreceiptid count in db."))?; + let count = + utils::u64_from_bytes(&k[prefix.len()..prefix.len() + size_of::()]) + .map_err(|_| { + Error::bad_database("Invalid readreceiptid count in db.") + })?; let user_id = UserId::parse( - utils::string_from_bytes(&k[prefix.len() + mem::size_of::() + 1..]) + utils::string_from_bytes(&k[prefix.len() + size_of::() + 1..]) .map_err(|_| { Error::bad_database("Invalid readreceiptid userid bytes in db.") })?, diff --git a/src/database/key_value/rooms/pdu_metadata.rs b/src/database/key_value/rooms/pdu_metadata.rs index 0641f9d8..dbc9bfb8 100644 --- a/src/database/key_value/rooms/pdu_metadata.rs +++ b/src/database/key_value/rooms/pdu_metadata.rs @@ -1,4 +1,4 @@ -use std::{mem, sync::Arc}; +use std::sync::Arc; use ruma::{EventId, RoomId, UserId}; @@ -40,7 +40,7 @@ impl service::rooms::pdu_metadata::Data for KeyValueDatabase { .iter_from(¤t, true) .take_while(move |(k, _)| k.starts_with(&prefix)) .map(move |(tofrom, _data)| { - let from = utils::u64_from_bytes(&tofrom[(mem::size_of::())..]) + let from = utils::u64_from_bytes(&tofrom[(size_of::())..]) .map_err(|_| Error::bad_database("Invalid count in tofrom_relation."))?; let mut pduid = shortroomid.to_be_bytes().to_vec(); diff --git a/src/database/key_value/rooms/threads.rs b/src/database/key_value/rooms/threads.rs index 5e3dc970..bfdc0cc5 100644 --- a/src/database/key_value/rooms/threads.rs +++ b/src/database/key_value/rooms/threads.rs @@ -1,5 +1,3 @@ -use std::mem; - use ruma::{api::client::threads::get_threads::v1::IncludeThreads, OwnedUserId, RoomId, UserId}; use crate::{database::KeyValueDatabase, service, services, utils, Error, PduEvent, Result}; @@ -28,7 +26,7 @@ impl service::rooms::threads::Data for KeyValueDatabase { .iter_from(¤t, true) .take_while(move |(k, _)| k.starts_with(&prefix)) .map(move |(pduid, _users)| { - let count = utils::u64_from_bytes(&pduid[(mem::size_of::())..]) + let count = utils::u64_from_bytes(&pduid[(size_of::())..]) .map_err(|_| Error::bad_database("Invalid pduid in threadid_userids."))?; let mut pdu = services() .rooms