Skip to content

Commit d57a9ad

Browse files
Update to 2024 edition
All of the changes outside of Cargo.toml are the result of running `cargo fmt --all` to update to the 2024 edition's formatting style.
1 parent edd4618 commit d57a9ad

File tree

5 files changed

+33
-27
lines changed

5 files changed

+33
-27
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ members = ["fuzz", "sbat", "sbat-tool"]
1111
resolver = "2"
1212

1313
[workspace.package]
14-
edition = "2021"
14+
edition = "2024"
1515
license = "MIT OR Apache-2.0"
1616
repository = "https://github.com/google/sbat-rs"
1717
rust-version = "1.85"

sbat-tool/src/main.rs

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
use anyhow::{anyhow, Result};
9+
use anyhow::{Result, anyhow};
1010
use ascii::AsciiStr;
1111
use clap::{Parser, Subcommand};
1212
use fs_err as fs;
1313
use itertools::Itertools;
1414
use object::{Object, ObjectSection};
1515
use sbat::{
16-
ImageSbat, RevocationSbat, RevocationSection, REVOCATION_SECTION_NAME,
16+
ImageSbat, REVOCATION_SECTION_NAME, RevocationSbat, RevocationSection,
1717
SBAT_SECTION_NAME,
1818
};
1919
use std::io::{self, Write};
@@ -237,26 +237,32 @@ mod tests {
237237
/// Test that a bad input path doesn't cause a panic.
238238
#[test]
239239
fn test_invalid_path() {
240-
assert!(run_action(&Args {
241-
action: Action::Dump {
242-
section: SBAT_SECTION_NAME.into(),
243-
input: "/bad/path".into(),
244-
}
245-
})
246-
.is_err());
240+
assert!(
241+
run_action(&Args {
242+
action: Action::Dump {
243+
section: SBAT_SECTION_NAME.into(),
244+
input: "/bad/path".into(),
245+
}
246+
})
247+
.is_err()
248+
);
247249

248-
assert!(run_action(&Args {
249-
action: Action::Validate {
250-
input: vec!["/bad/path".into()],
251-
}
252-
})
253-
.is_err());
250+
assert!(
251+
run_action(&Args {
252+
action: Action::Validate {
253+
input: vec!["/bad/path".into()],
254+
}
255+
})
256+
.is_err()
257+
);
254258

255-
assert!(run_action(&Args {
256-
action: Action::ValidateRevocations {
257-
input: vec!["/bad/path".into()],
258-
}
259-
})
260-
.is_err());
259+
assert!(
260+
run_action(&Args {
261+
action: Action::ValidateRevocations {
262+
input: vec!["/bad/path".into()],
263+
}
264+
})
265+
.is_err()
266+
);
261267
}
262268
}

sbat/src/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! executable. See the crate documentation for details of how it is
1313
//! used.
1414
15-
use crate::csv::{trim_ascii_at_null, CsvIter, Record};
15+
use crate::csv::{CsvIter, Record, trim_ascii_at_null};
1616
use crate::{Component, ParseError};
1717
use ascii::AsciiStr;
1818
use core::ptr;

sbat/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ mod revocations;
8080
#[cfg(feature = "alloc")]
8181
mod alloc;
8282

83+
pub use ValidationResult::{Allowed, Revoked};
8384
pub use component::Component;
8485
pub use csv::ALLOWED_SPECIAL_CHARS;
8586
pub use error::ParseError;
8687
pub use generation::Generation;
87-
pub use image::{Entries, Entry, ImageSbat, Vendor, SBAT_SECTION_NAME};
88+
pub use image::{Entries, Entry, ImageSbat, SBAT_SECTION_NAME, Vendor};
8889
pub use revocation_section::{
89-
RevocationSection, RevocationSectionError, REVOCATION_SECTION_NAME,
90+
REVOCATION_SECTION_NAME, RevocationSection, RevocationSectionError,
9091
};
9192
pub use revocations::{RevocationSbat, RevokedComponents, ValidationResult};
92-
pub use ValidationResult::{Allowed, Revoked};
9393

9494
#[cfg(feature = "alloc")]
9595
pub use alloc::{ImageSbatOwned, RevocationSbatOwned};

sbat/src/revocations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Typically this data is read from a UEFI variable. See the crate
1212
//! documentation for details of how it is used.
1313
14-
use crate::csv::{trim_ascii_at_null, CsvIter};
14+
use crate::csv::{CsvIter, trim_ascii_at_null};
1515
use crate::{Component, Entry, ImageSbat, ParseError};
1616
use ascii::AsciiStr;
1717
use core::ptr;

0 commit comments

Comments
 (0)