diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78ec992e..472ccfb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: run: target/debug/xtask ci lint msrv: - name: Rust 1.60 / ${{ matrix.name }} + name: Rust 1.62 / ${{ matrix.name }} needs: xtask runs-on: ubuntu-latest strategy: @@ -98,11 +98,11 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 - - name: Install rust 1.60 toolchain + - name: Install rust 1.62 toolchain uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: "1.60" + toolchain: "1.62" # Used to compile xtask - name: Install rust stable toolchain @@ -117,7 +117,7 @@ jobs: # A stable compiler update should automatically not reuse old caches. # Add the MSRV as a stable cache key too so bumping it also gets us a # fresh cache. - sharedKey: msrv1.60 + sharedKey: msrv1.62 - name: Get xtask uses: actions/cache@v3 @@ -249,7 +249,7 @@ jobs: - name: Build docs run: target/debug/xtask doc --deny-warnings - + - name: Compress docs if: github.event_name == 'pull_request' run: | diff --git a/README.md b/README.md index 211cabf9..c3c5c54b 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). ## Minimum Rust version -Ruma currently requires Rust 1.60. In general, we will never require beta or +Ruma currently requires Rust 1.62. In general, we will never require beta or nightly for crates.io releases of our crates, and we will try to avoid releasing crates that depend on features that were only just stabilized. diff --git a/crates/ruma-appservice-api/Cargo.toml b/crates/ruma-appservice-api/Cargo.toml index 8a5240b0..35dddac3 100644 --- a/crates/ruma-appservice-api/Cargo.toml +++ b/crates/ruma-appservice-api/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" repository = "https://github.com/ruma/ruma" version = "0.7.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-client-api/Cargo.toml b/crates/ruma-client-api/Cargo.toml index cadd72ff..ca7deb94 100644 --- a/crates/ruma-client-api/Cargo.toml +++ b/crates/ruma-client-api/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" repository = "https://github.com/ruma/ruma" version = "0.15.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-client/Cargo.toml b/crates/ruma-client/Cargo.toml index f153acd3..ff2ad45b 100644 --- a/crates/ruma-client/Cargo.toml +++ b/crates/ruma-client/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" repository = "https://github.com/ruma/ruma" version = "0.10.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-common/Cargo.toml b/crates/ruma-common/Cargo.toml index f112f634..9cb1df92 100644 --- a/crates/ruma-common/Cargo.toml +++ b/crates/ruma-common/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" readme = "README.md" repository = "https://github.com/ruma/ruma" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-common/src/events/room/message.rs b/crates/ruma-common/src/events/room/message.rs index 800c96b3..59c3e10d 100644 --- a/crates/ruma-common/src/events/room/message.rs +++ b/crates/ruma-common/src/events/room/message.rs @@ -149,7 +149,7 @@ impl RoomMessageEventContent { (*body, *formatted_body) = reply::plain_and_formatted_reply_body( body.as_str(), - (!formatted_body.is_empty()).then(|| formatted_body.as_str()), + (!formatted_body.is_empty()).then_some(formatted_body.as_str()), original_message, ); } diff --git a/crates/ruma-common/src/events/room/message/reply.rs b/crates/ruma-common/src/events/room/message/reply.rs index 6cbb6554..ac518008 100644 --- a/crates/ruma-common/src/events/room/message/reply.rs +++ b/crates/ruma-common/src/events/room/message/reply.rs @@ -11,7 +11,7 @@ fn get_message_quote_fallbacks(original_message: &OriginalRoomMessageEvent) -> ( let get_quotes = |body: &str, formatted: Option<&FormattedBody>, is_emote: bool| { let OriginalRoomMessageEvent { room_id, event_id, sender, content, .. } = original_message; let is_reply = matches!(content.relates_to, Some(Relation::Reply { .. })); - let emote_sign = is_emote.then(|| "* ").unwrap_or_default(); + let emote_sign = is_emote.then_some("* ").unwrap_or_default(); let body = is_reply.then(|| remove_plain_reply_fallback(body)).unwrap_or(body); #[cfg(feature = "unstable-sanitize")] let html_body = formatted_or_plain_body(formatted, body, is_reply); diff --git a/crates/ruma-federation-api/Cargo.toml b/crates/ruma-federation-api/Cargo.toml index 358c9df9..eb3d040b 100644 --- a/crates/ruma-federation-api/Cargo.toml +++ b/crates/ruma-federation-api/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" repository = "https://github.com/ruma/ruma" version = "0.6.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-identifiers-validation/Cargo.toml b/crates/ruma-identifiers-validation/Cargo.toml index 338580e9..fef39131 100644 --- a/crates/ruma-identifiers-validation/Cargo.toml +++ b/crates/ruma-identifiers-validation/Cargo.toml @@ -6,7 +6,7 @@ repository = "https://github.com/ruma/ruma" license = "MIT" version = "0.9.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-identity-service-api/Cargo.toml b/crates/ruma-identity-service-api/Cargo.toml index 7344e8af..df60479b 100644 --- a/crates/ruma-identity-service-api/Cargo.toml +++ b/crates/ruma-identity-service-api/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" readme = "README.md" repository = "https://github.com/ruma/ruma" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-macros/Cargo.toml b/crates/ruma-macros/Cargo.toml index 9e46b5e9..493bb4b9 100644 --- a/crates/ruma-macros/Cargo.toml +++ b/crates/ruma-macros/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" repository = "https://github.com/ruma/ruma" version = "0.10.3" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [lib] proc-macro = true diff --git a/crates/ruma-push-gateway-api/Cargo.toml b/crates/ruma-push-gateway-api/Cargo.toml index 7324d270..20e093c5 100644 --- a/crates/ruma-push-gateway-api/Cargo.toml +++ b/crates/ruma-push-gateway-api/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" readme = "README.md" repository = "https://github.com/ruma/ruma" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-server-util/Cargo.toml b/crates/ruma-server-util/Cargo.toml index 4a867bbb..78539565 100644 --- a/crates/ruma-server-util/Cargo.toml +++ b/crates/ruma-server-util/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" repository = "https://github.com/ruma/ruma" version = "0.1.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-state-res/Cargo.toml b/crates/ruma-state-res/Cargo.toml index 237852ec..dfed461b 100644 --- a/crates/ruma-state-res/Cargo.toml +++ b/crates/ruma-state-res/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" license = "MIT" version = "0.8.0" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/crates/ruma-state-res/src/event_auth.rs b/crates/ruma-state-res/src/event_auth.rs index c311ed8e..bbc07128 100644 --- a/crates/ruma-state-res/src/event_auth.rs +++ b/crates/ruma-state-res/src/event_auth.rs @@ -473,10 +473,10 @@ fn valid_membership_change( let sender_power = power_levels .users .get(sender) - .or_else(|| sender_is_joined.then(|| &power_levels.users_default)); + .or_else(|| sender_is_joined.then_some(&power_levels.users_default)); let target_power = power_levels.users.get(target_user).or_else(|| { - (target_membership == MembershipState::Join).then(|| &power_levels.users_default) + (target_membership == MembershipState::Join).then_some(&power_levels.users_default) }); let mut join_rules = JoinRule::Invite; diff --git a/crates/ruma-state-res/src/lib.rs b/crates/ruma-state-res/src/lib.rs index 1104b549..9443f509 100644 --- a/crates/ruma-state-res/src/lib.rs +++ b/crates/ruma-state-res/src/lib.rs @@ -201,7 +201,7 @@ where *id_counts.entry(id).or_default() += 1; } - id_counts.into_iter().filter_map(move |(id, count)| (count < num_sets).then(move || id)) + id_counts.into_iter().filter_map(move |(id, count)| (count < num_sets).then_some(id)) } /// Events are sorted from "earliest" to "latest". @@ -437,7 +437,7 @@ fn iterative_auth_check( // The key for this is (eventType + a state_key of the signed token not sender) so // search for it let current_third_party = auth_events.iter().find_map(|(_, pdu)| { - (*pdu.event_type() == RoomEventType::RoomThirdPartyInvite).then(|| pdu) + (*pdu.event_type() == RoomEventType::RoomThirdPartyInvite).then_some(pdu) }); if auth_check(room_version, &event, current_third_party, |ty, key| { diff --git a/crates/ruma/Cargo.toml b/crates/ruma/Cargo.toml index bfe4ea97..0f14a74e 100644 --- a/crates/ruma/Cargo.toml +++ b/crates/ruma/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" license = "MIT" version = "0.7.3" edition = "2021" -rust-version = "1.60" +rust-version = "1.62" [package.metadata.docs.rs] all-features = true diff --git a/xtask/src/ci.rs b/xtask/src/ci.rs index 8eeb34d2..f55cd3ac 100644 --- a/xtask/src/ci.rs +++ b/xtask/src/ci.rs @@ -9,7 +9,7 @@ mod spec_links; use spec_links::check_spec_links; -const MSRV: &str = "1.60"; +const MSRV: &str = "1.62"; const NIGHTLY: &str = "nightly"; #[derive(Args)]