From 65dbe449996c6937cfa9d55e5d97c525d98a5412 Mon Sep 17 00:00:00 2001 From: nikstur Date: Wed, 17 May 2023 21:40:03 +0200 Subject: [PATCH] stub: format with rustfmt --- rust/tool/src/generation.rs | 9 +++++---- rust/tool/src/os_release.rs | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rust/tool/src/generation.rs b/rust/tool/src/generation.rs index 47ef0bc..377f899 100644 --- a/rust/tool/src/generation.rs +++ b/rust/tool/src/generation.rs @@ -4,9 +4,9 @@ use std::os::unix::fs::MetadataExt; use std::path::{Path, PathBuf}; use anyhow::{anyhow, Context, Result}; -use bootspec::BootSpec; -use bootspec::BootJson; use bootspec::generation::Generation as BootspecGeneration; +use bootspec::BootJson; +use bootspec::BootSpec; use bootspec::SpecialisationName; use time::Date; @@ -55,7 +55,7 @@ impl Generation { // TODO: replace me when https://github.com/DeterminateSystems/bootspec/pull/109 lands. let bootspec: BootSpec = match boot_json.generation { BootspecGeneration::V1(bootspec) => bootspec, - _ => return Err(anyhow!("Unsupported bootspec schema")) + _ => return Err(anyhow!("Unsupported bootspec schema")), }; Ok(Self { @@ -104,7 +104,8 @@ impl fmt::Display for Generation { } fn read_build_time(path: &Path) -> Result { - let build_time = time::OffsetDateTime::from_unix_timestamp(fs::symlink_metadata(path)?.mtime())?.date(); + let build_time = + time::OffsetDateTime::from_unix_timestamp(fs::symlink_metadata(path)?.mtime())?.date(); Ok(build_time) } diff --git a/rust/tool/src/os_release.rs b/rust/tool/src/os_release.rs index 845b948..42e75c1 100644 --- a/rust/tool/src/os_release.rs +++ b/rust/tool/src/os_release.rs @@ -26,7 +26,10 @@ impl OsRelease { // Because the ID field here does not have the same meaning as in a real os-release file, // it is fine to use a dummy value. map.insert("ID".into(), String::from("lanza")); - map.insert("PRETTY_NAME".into(), generation.spec.bootspec.bootspec.label.clone()); + map.insert( + "PRETTY_NAME".into(), + generation.spec.bootspec.bootspec.label.clone(), + ); map.insert("VERSION_ID".into(), generation.describe()); Ok(Self(map))