Skip to content

Commit eb104b9

Browse files
committed
cargo fmt
1 parent 614d4e3 commit eb104b9

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

auditable-serde/src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,36 @@ use std::str::FromStr;
3737
pub struct VersionInfo {
3838
pub packages: Vec<Package>,
3939
/// Format revision of the audit data.
40-
///
40+
///
4141
/// Format revisions are **backwards compatible.**
4242
/// If an unknown format is encountered, it should be treated as the highest known preceding format.
4343
/// For example, if formats `0`, `1` and `8` are known, format `4` should be treated as if it's `1`.
44-
///
44+
///
4545
/// ## Known formats
46-
///
46+
///
4747
/// ### 0 (or the field is absent)
48-
///
48+
///
4949
/// Generated based on the data provided by [`cargo metadata`](https://doc.rust-lang.org/cargo/commands/cargo-metadata.html).
50-
///
50+
///
5151
/// There are multiple [known](https://github.com/rust-lang/cargo/issues/7754)
5252
/// [issues](https://github.com/rust-lang/cargo/issues/10718) with this data source,
5353
/// leading to the audit data sometimes including more dependencies than are really used in the build.
54-
///
54+
///
5555
/// However, is the only machine-readable data source available on stable Rust as of v1.88.
56-
///
57-
/// Additionally, this format incorrectly includes [procedural macros](https://doc.rust-lang.org/reference/procedural-macros.html)
56+
///
57+
/// Additionally, this format incorrectly includes [procedural macros](https://doc.rust-lang.org/reference/procedural-macros.html)
5858
/// and their dependencies as runtime dependencies while in reality they are build-time dependencies.
59-
///
60-
/// ### 1
61-
///
59+
///
60+
/// ### 1
61+
///
6262
/// Same as 0, but correctly records proc-macros and their dependencies as build-time dependencies.
63-
///
63+
///
6464
/// May still include slightly more dependencies than are actually used, especially in workspaces.
65-
///
65+
///
6666
/// ### 8
67-
///
67+
///
6868
/// Generated using Cargo's [SBOM precursor](https://doc.rust-lang.org/cargo/reference/unstable.html#sbom) as the data source.
69-
///
69+
///
7070
/// This data is highly accurate, but as of Rust v1.88 can only be generated using a nightly build of Cargo.
7171
#[serde(default)]
7272
#[serde(skip_serializing_if = "is_default")]

auditable-serde/src/validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{Package, VersionInfo, is_default};
1+
use crate::{is_default, Package, VersionInfo};
22
use serde::{Deserialize, Serialize};
33
use std::{convert::TryFrom, fmt::Display};
44

cargo-auditable/src/auditable_from_metadata.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ pub fn encode_audit_data(
218218
package.dependencies.sort_unstable();
219219
}
220220
}
221-
Ok(VersionInfo { packages, format: 1 })
221+
Ok(VersionInfo {
222+
packages,
223+
format: 1,
224+
})
222225
}
223226

224227
fn strongest_dep_kind(deps: &[cargo_metadata::DepKindInfo]) -> PrivateDepKind {

cargo-auditable/src/sbom_precursor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ impl From<SbomPrecursor> for VersionInfo {
8989
}
9090
}
9191

92-
VersionInfo { packages, format: 8 }
92+
VersionInfo {
93+
packages,
94+
format: 8,
95+
}
9396
}
9497
}
9598

0 commit comments

Comments
 (0)