Skip to content

Commit b0e1e40

Browse files
Copilotsjoerdsimons
andcommitted
Update CI to use Rust 1.85
Rust 1.85 is the current version in Debian Trixie, so update to that. Co-authored-by: sjoerdsimons <[email protected]>
1 parent 23c7149 commit b0e1e40

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
1919
with:
20-
toolchain: "1.70"
20+
toolchain: "1.85"
2121
- run: cargo check --all-targets --all-features
2222
fmt:
2323
name: cargo fmt
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v4
2727
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
2828
with:
29-
toolchain: "1.70"
29+
toolchain: "1.85"
3030
components: rustfmt
3131
- run: cargo fmt --all --check
3232
test:
@@ -38,7 +38,7 @@ jobs:
3838
lfs: 'true'
3939
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
4040
with:
41-
toolchain: "1.70"
41+
toolchain: "1.85"
4242
- run: cargo test --all-targets --all-features
4343

4444
clippy:
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions/checkout@v4
4949
- uses: dtolnay/rust-toolchain@master # avoid the tag here to prevent dependabot from updating it
5050
with:
51-
toolchain: "1.70"
51+
toolchain: "1.85"
5252
components: clippy
5353
- run: cargo clippy --all-targets --all-features -- -D warnings
5454

bmap-parser/src/bmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl Bmap {
9696
}
9797

9898
/// Iterator over the block map
99-
pub fn block_map(&self) -> impl ExactSizeIterator + Iterator<Item = &BlockRange> {
99+
pub fn block_map(&self) -> impl ExactSizeIterator<Item = &BlockRange> {
100100
self.blockmap.iter()
101101
}
102102

bmap-parser/src/bmap/xml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn str_to_digest(s: String, digest: &mut [u8]) -> Result<(), XmlError> {
9191
Some(v) => v,
9292
None => return Err(XmlError::InvalidChecksum(s)),
9393
};
94-
digest[i] = hi << 4 | lo;
94+
digest[i] = (hi << 4) | lo;
9595
}
9696

9797
Ok(())

bmap-parser/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ where
8585
left -= r;
8686
}
8787
let digest = hasher.finalize_reset();
88-
if range.checksum().as_slice() != digest.as_slice() {
88+
if range.checksum().as_slice() != &digest[..] {
8989
return Err(CopyError::ChecksumError);
9090
}
9191

@@ -139,7 +139,7 @@ where
139139
left -= r;
140140
}
141141
let digest = hasher.finalize_reset();
142-
if range.checksum().as_slice() != digest.as_slice() {
142+
if range.checksum().as_slice() != &digest[..] {
143143
return Err(CopyError::ChecksumError);
144144
}
145145

bmap-parser/tests/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn parse() {
1818
assert_eq!((block + 1) * 4096, range.length());
1919

2020
let digest = Sha256::digest(format!("{}", block).as_bytes());
21-
assert_eq!(digest.as_slice(), range.checksum().as_slice());
21+
assert_eq!(&digest[..], range.checksum().as_slice());
2222

2323
block = if block == 0 { 8 } else { block * 4 };
2424
}

bmap-rs/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ fn copy_local_input(source: PathBuf, destination: PathBuf) -> Result<()> {
206206
let output = std::fs::OpenOptions::new()
207207
.write(true)
208208
.create(true)
209+
.truncate(true)
209210
.open(destination)?;
210211

211212
setup_output(&output, &bmap, output.metadata()?)?;
@@ -231,6 +232,7 @@ async fn copy_remote_input(source: Url, destination: PathBuf) -> Result<()> {
231232
let mut output = tokio::fs::OpenOptions::new()
232233
.write(true)
233234
.create(true)
235+
.truncate(true)
234236
.open(destination)
235237
.await?;
236238

@@ -263,6 +265,7 @@ fn copy_local_input_nobmap(source: PathBuf, destination: PathBuf) -> Result<()>
263265
let output = std::fs::OpenOptions::new()
264266
.write(true)
265267
.create(true)
268+
.truncate(true)
266269
.open(destination)?;
267270

268271
let mut input = setup_local_input(&source)?;
@@ -281,6 +284,7 @@ async fn copy_remote_input_nobmap(source: Url, destination: PathBuf) -> Result<(
281284
let mut output = tokio::fs::OpenOptions::new()
282285
.write(true)
283286
.create(true)
287+
.truncate(true)
284288
.open(destination)
285289
.await?;
286290

0 commit comments

Comments
 (0)