Skip to content

Commit 1d79eb1

Browse files
Update to 2024 edition
1 parent fd3d319 commit 1d79eb1

5 files changed

Lines changed: 16 additions & 14 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[workspace]
22
members = ["ovmf-prebuilt", "xtask"]
3-
resolver = "2"
3+
resolver = "3"
44

55
[workspace.package]
6-
edition = "2021"
6+
edition = "2024"
77

88
[workspace.dependencies]
99
ureq = { version = "3.0", default-features = false, features = ["rustls"] }

ovmf-prebuilt/src/fetch.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ pub(crate) fn update_cache(source: Source, prebuilt_dir: &Path) -> Result<(), Er
2323

2424
// Check if the hash file already has the expected hash in it. If so, assume
2525
// that we've already got the correct prebuilt downloaded and unpacked.
26-
if let Ok(current_hash) = fs::read_to_string(&hash_path) {
27-
if current_hash == source.sha256 {
28-
return Ok(());
29-
}
26+
if let Ok(current_hash) = fs::read_to_string(&hash_path)
27+
&& current_hash == source.sha256
28+
{
29+
return Ok(());
3030
}
3131

3232
let base_url = "https://github.com/rust-osdev/ovmf-prebuilt/releases/download";
@@ -191,11 +191,13 @@ mod tests {
191191
#[test]
192192
fn test_retry_failure() {
193193
let mut attempts = 0;
194-
assert!(retry(2, || {
195-
attempts += 1;
196-
Err(Error::Download(io::ErrorKind::Interrupted.into()))
197-
})
198-
.is_err());
194+
assert!(
195+
retry(2, || {
196+
attempts += 1;
197+
Err(Error::Download(io::ErrorKind::Interrupted.into()))
198+
})
199+
.is_err()
200+
);
199201
assert_eq!(attempts, 3);
200202
}
201203
}

xtask/src/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{bail, Context, Result};
1+
use anyhow::{Context, Result, bail};
22
use serde::Deserialize;
33
use ureq::Agent;
44

xtask/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mod github;
22
mod update_sources;
33

4-
use anyhow::{anyhow, bail, Result};
4+
use anyhow::{Result, anyhow, bail};
55
use clap::{Args, Parser, Subcommand};
66
use std::fs;
77
use std::path::PathBuf;

xtask/src/update_sources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::github::Github;
2-
use anyhow::{bail, Result};
2+
use anyhow::{Result, bail};
33
use std::fs;
44
use std::path::Path;
55

0 commit comments

Comments
 (0)