From 4b75e60e31249457fc472ec745d01c9e3ef2e0d1 Mon Sep 17 00:00:00 2001 From: Elaina <48662592+oestradiol@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:22:07 -0300 Subject: [PATCH] chore: Bumping MSRV to 1.75 (#233) * chore: Bumping MSRV to 1.75 * Formatting * Bumping version on Cargo.toml * Configuring matrix workflow * Bringing back actions-rust-lang/setup-rust-toolchain@v1 * Removing "Install Rust Problem Matcher" --- .github/rust.json | 33 --------------------------------- .github/workflows/rust.yml | 11 +++++++---- Cargo.toml | 2 +- bsky-sdk/src/rich_text.rs | 2 +- rust-toolchain.toml | 2 +- 5 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 .github/rust.json diff --git a/.github/rust.json b/.github/rust.json deleted file mode 100644 index 0b58b7bb..00000000 --- a/.github/rust.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "rustfmt", - "severity": "warning", - "pattern": [ - { - "regexp": "^(Diff in (.+)) at line (\\d+):$", - "message": 1, - "file": 2, - "line": 3 - } - ] - }, - { - "owner": "clippy", - "pattern": [ - { - "regexp": "^(?:\\x1b\\[[\\d;]+m)*(warning|warn|error)(?:\\x1b\\[[\\d;]+m)*(\\[(.*)\\])?(?:\\x1b\\[[\\d;]+m)*:(?:\\x1b\\[[\\d;]+m)* ([^\\x1b]*)(?:\\x1b\\[[\\d;]+m)*$", - "severity": 1, - "message": 4, - "code": 3 - }, - { - "regexp": "^(?:\\x1b\\[[\\d;]+m)*\\s*(?:\\x1b\\[[\\d;]+m)*\\s*--> (?:\\x1b\\[[\\d;]+m)*(.*):(\\d*):(\\d*)(?:\\x1b\\[[\\d;]+m)*$", - "file": 1, - "line": 2, - "column": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index acf3904b..cb388147 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -21,6 +21,10 @@ jobs: strategy: fail-fast: false + matrix: + rust: + - 1.75.0 + - stable steps: - name: Checkout repository @@ -28,10 +32,9 @@ jobs: - name: Install Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 - - # https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json - - name: Install Rust Problem Matcher - run: echo "::add-matcher::.github/rust.json" + with: + toolchain: ${{ matrix.rust }} + components: rustfmt, clippy - name: Bump opt-level run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml diff --git a/Cargo.toml b/Cargo.toml index cb829c51..ffacaf5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ resolver = "2" [workspace.package] edition = "2021" -rust-version = "1.70" +rust-version = "1.75" repository = "https://github.com/sugyan/atrium" license = "MIT" keywords = ["atproto", "bluesky"] diff --git a/bsky-sdk/src/rich_text.rs b/bsky-sdk/src/rich_text.rs index 5c6a7d17..f1783722 100644 --- a/bsky-sdk/src/rich_text.rs +++ b/bsky-sdk/src/rich_text.rs @@ -102,7 +102,7 @@ impl RichText { /// Get segments of the rich text. pub fn segments(&self) -> Vec { let Some(facets) = self.facets.as_ref() else { - return vec![RichTextSegment::new(&self.text, None)] + return vec![RichTextSegment::new(&self.text, None)]; }; let mut segments = Vec::new(); let (mut text_cursor, mut facet_cursor) = (0, 0); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5299106e..f7435176 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.70.0" +channel = "1.75.0" components = ["clippy", "rustfmt"]