Skip to content

Commit 4da2927

Browse files
authored
Merge pull request #2217 from GitoxideLabs/copilot/update-msrv-to-rust-1-82
Update MSRV to Rust 1.82 and replace once_cell with std equivalents
2 parents feccdf8 + 6819e54 commit 4da2927

File tree

189 files changed

+364
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+364
-475
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ jobs:
187187
persist-credentials: false
188188
- uses: dtolnay/rust-toolchain@stable
189189
- uses: Swatinem/rust-cache@v2
190+
with:
191+
save-if: ${{ github.ref == 'refs/heads/main' }}
190192
- name: Setup dependencies
191193
run: |
192194
sudo apt-get update
@@ -209,6 +211,8 @@ jobs:
209211
persist-credentials: false
210212
- uses: dtolnay/rust-toolchain@stable
211213
- uses: Swatinem/rust-cache@v2
214+
with:
215+
save-if: ${{ github.ref == 'refs/heads/main' }}
212216
- uses: extractions/setup-just@v3
213217
- name: Run journey tests
214218
run: just ci-journey-tests
@@ -235,6 +239,8 @@ jobs:
235239
persist-credentials: false
236240
- uses: dtolnay/rust-toolchain@stable
237241
- uses: Swatinem/rust-cache@v2
242+
with:
243+
save-if: ${{ github.ref == 'refs/heads/main' }}
238244
- name: cargo check default features
239245
if: startsWith(matrix.os, 'windows')
240246
run: cargo check --workspace --bins --examples
@@ -284,6 +290,8 @@ jobs:
284290
persist-credentials: false
285291
- uses: dtolnay/rust-toolchain@stable
286292
- uses: Swatinem/rust-cache@v2
293+
with:
294+
save-if: ${{ github.ref == 'refs/heads/main' }}
287295
- uses: taiki-e/install-action@v2
288296
with:
289297
tool: nextest
@@ -363,6 +371,8 @@ jobs:
363371
- name: Add Rust tools to path
364372
run: echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV"
365373
- uses: Swatinem/rust-cache@v2
374+
with:
375+
save-if: ${{ github.ref == 'refs/heads/main' }}
366376
- uses: taiki-e/install-action@v2
367377
with:
368378
tool: nextest
@@ -387,6 +397,8 @@ jobs:
387397
with:
388398
targets: ${{ env.TARGET }}
389399
- uses: Swatinem/rust-cache@v2
400+
with:
401+
save-if: ${{ github.ref == 'refs/heads/main' }}
390402
- uses: taiki-e/install-action@v2
391403
with:
392404
tool: nextest
@@ -473,6 +485,8 @@ jobs:
473485
rustup default stable
474486
rustup target add "$TARGET"
475487
- uses: Swatinem/rust-cache@v2
488+
with:
489+
save-if: ${{ github.ref == 'refs/heads/main' }}
476490
- name: 'WASI only: crates without feature toggle'
477491
if: endsWith(matrix.target, '-wasi')
478492
run: |

.github/workflows/cron.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ jobs:
1717
with:
1818
persist-credentials: false
1919
- uses: Swatinem/rust-cache@v2
20+
with:
21+
save-if: ${{ github.ref == 'refs/heads/main' }}
2022
- name: stress
2123
run: make stress

Cargo.lock

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
version = "0.45.0"
11-
rust-version = "1.74"
11+
rust-version = "1.82"
1212
default-run = "gix"
1313
include = ["src/**/*", "/build.rs", "LICENSE-*", "README.md"]
1414
resolver = "2"
@@ -174,7 +174,6 @@ terminal_size = "0.4.2"
174174
# Avoid pre-compiled binaries, see https://github.com/serde-rs/serde/issues/2538 and https://github.com/serde-rs/serde/pull/2590
175175
serde_derive = ">=1.0.185"
176176

177-
once_cell = "1.21.3"
178177
document-features = { version = "0.2.0", optional = true }
179178
[profile.dev.package]
180179
insta.opt-level = 3

etc/msrv-badge.svg

Lines changed: 4 additions & 4 deletions
Loading

gix-actor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repository = "https://github.com/GitoxideLabs/gitoxide"
99
license = "MIT OR Apache-2.0"
1010
edition = "2021"
1111
include = ["src/**/*", "LICENSE-*"]
12-
rust-version = "1.70"
12+
rust-version = "1.82"
1313

1414
[lib]
1515
doctest = false

gix-actor/src/signature/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub(crate) mod write {
110110

111111
impl From<Error> for std::io::Error {
112112
fn from(err: Error) -> Self {
113-
std::io::Error::new(std::io::ErrorKind::Other, err)
113+
std::io::Error::other(err)
114114
}
115115
}
116116

gix-archive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
88
description = "archive generation from of a worktree stream"
99
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
1010
edition = "2021"
11-
rust-version = "1.70"
11+
rust-version = "1.82"
1212
include = ["src/**/*", "LICENSE-*"]
1313

1414
[lib]

gix-archive/src/write.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ where
160160
opts.tree_prefix.as_ref(),
161161
)?;
162162
}
163-
ar.finish()
164-
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?;
163+
ar.finish().map_err(std::io::Error::other)?;
165164
}
166165

167166
Ok(())
@@ -179,25 +178,25 @@ fn append_zip_entry<W: std::io::Write + std::io::Seek>(
179178
let file_opts = zip::write::SimpleFileOptions::default()
180179
.compression_method(zip::CompressionMethod::Deflated)
181180
.compression_level(compression_level)
182-
.large_file(entry.bytes_remaining().map_or(true, |len| len > u32::MAX as usize))
181+
.large_file(entry.bytes_remaining().is_none_or(|len| len > u32::MAX as usize))
183182
.last_modified_time(mtime)
184183
.unix_permissions(if entry.mode.is_executable() { 0o755 } else { 0o644 });
185184
let path = add_prefix(entry.relative_path(), tree_prefix).into_owned();
186185
match entry.mode.kind() {
187186
gix_object::tree::EntryKind::Blob | gix_object::tree::EntryKind::BlobExecutable => {
188187
ar.start_file(path.to_string(), file_opts)
189-
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?;
188+
.map_err(std::io::Error::other)?;
190189
std::io::copy(&mut entry, ar)?;
191190
}
192191
gix_object::tree::EntryKind::Tree | gix_object::tree::EntryKind::Commit => {
193192
ar.add_directory(path.to_string(), file_opts)
194-
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?;
193+
.map_err(std::io::Error::other)?;
195194
}
196195
gix_object::tree::EntryKind::Link => {
197196
use bstr::ByteSlice;
198197
std::io::copy(&mut entry, buf)?;
199198
ar.add_symlink(path.to_string(), buf.as_bstr().to_string(), file_opts)
200-
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?;
199+
.map_err(std::io::Error::other)?;
201200
}
202201
}
203202
Ok(())

gix-attributes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project dealing .gitattributes files"
99
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
1010
edition = "2021"
1111
include = ["src/**/*", "LICENSE-*"]
12-
rust-version = "1.70"
12+
rust-version = "1.82"
1313

1414
[lib]
1515
doctest = false

0 commit comments

Comments
 (0)