Skip to content

Commit

Permalink
tree-wide: rustfmt with group_imports = "StdExternalCrate"
Browse files Browse the repository at this point in the history
We were inconsistent here; I prefer this `StdExternalCrate`
style. Unfortunately it's not stabilized, but this is a manual
run with current nightly rustfmt. On the positive side, rustfmt
will preserve this ordering in the future.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jun 26, 2024
1 parent 969d032 commit 5a03760
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
18 changes: 10 additions & 8 deletions lib/src/blockdev.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
use crate::install::run_in_host_mountns;
use crate::task::Task;
use anyhow::{anyhow, Context, Result};
use camino::{Utf8Path, Utf8PathBuf};
use fn_error_context::context;
use nix::errno::Errno;
use regex::Regex;
use serde::Deserialize;
use std::collections::HashMap;
use std::env;
use std::fs::File;
Expand All @@ -14,6 +6,16 @@ use std::path::Path;
use std::process::Command;
use std::sync::OnceLock;

use anyhow::{anyhow, Context, Result};
use camino::{Utf8Path, Utf8PathBuf};
use fn_error_context::context;
use nix::errno::Errno;
use regex::Regex;
use serde::Deserialize;

use crate::install::run_in_host_mountns;
use crate::task::Task;

#[derive(Debug, Deserialize)]
struct DevicesOutput {
blockdevices: Vec<Device>,
Expand Down
9 changes: 5 additions & 4 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
//!
//! Command line tool to manage bootable ostree-based containers.
use std::ffi::OsString;
use std::io::Seek;
use std::os::unix::process::CommandExt;
use std::process::Command;

use anyhow::{Context, Result};
use camino::Utf8PathBuf;
use cap_std_ext::cap_std;
Expand All @@ -13,10 +18,6 @@ use ostree_container::store::PrepareResult;
use ostree_ext::container as ostree_container;
use ostree_ext::keyfileext::KeyFileExt;
use ostree_ext::ostree;
use std::ffi::OsString;
use std::io::Seek;
use std::os::unix::process::CommandExt;
use std::process::Command;

use crate::deploy::RequiredHostSpec;
use crate::lints;
Expand Down
1 change: 0 additions & 1 deletion lib/src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::io::{BufRead, Write};

use anyhow::Ok;
use anyhow::{anyhow, Context, Result};

use cap_std::fs::{Dir, MetadataExt};
use cap_std_ext::cap_std;
use cap_std_ext::dirext::CapStdExtDirExt;
Expand Down
5 changes: 3 additions & 2 deletions lib/src/docgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

use std::fs::OpenOptions;
use std::io::Write;

use anyhow::{Context, Result};
use camino::Utf8Path;
use clap::{Command, CommandFactory};
use std::fs::OpenOptions;
use std::io::Write;

pub fn generate_manpages(directory: &Utf8Path) -> Result<()> {
generate_one(directory, crate::cli::Opt::command())
Expand Down
5 changes: 2 additions & 3 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ use cap_std_ext::cap_std;
use cap_std_ext::prelude::CapStdExtDirExt;
use chrono::prelude::*;
use clap::ValueEnum;
use ostree_ext::oci_spec;
use rustix::fs::{FileTypeExt, MetadataExt as _};

use fn_error_context::context;
use ostree::gio;
use ostree_ext::container as ostree_container;
use ostree_ext::oci_spec;
use ostree_ext::ostree;
use ostree_ext::prelude::Cast;
use rustix::fs::{FileTypeExt, MetadataExt as _};
use serde::{Deserialize, Serialize};

use self::baseline::InstallBlockDeviceOpts;
Expand Down
5 changes: 2 additions & 3 deletions lib/src/kargs.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
use anyhow::Ok;
use anyhow::Result;

use crate::deploy::ImageState;
use ostree::gio;
use ostree_ext::ostree;
use ostree_ext::ostree::Deployment;
use ostree_ext::prelude::Cast;
use ostree_ext::prelude::FileEnumeratorExt;
use ostree_ext::prelude::FileExt;

use serde::Deserialize;

use crate::deploy::ImageState;

#[derive(Deserialize)]
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
struct Config {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/lsm.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#[cfg(feature = "install")]
use std::io::Write;
use std::os::fd::AsRawFd;
use std::os::unix::process::CommandExt;
use std::path::Path;
use std::process::Command;
Expand All @@ -17,7 +18,6 @@ use gvariant::{aligned_bytes::TryAsAligned, Marker, Structure};
use ostree_ext::gio;
use ostree_ext::ostree;
use rustix::fd::AsFd;
use std::os::fd::AsRawFd;

/// The mount path for selinux
#[cfg(feature = "install")]
Expand Down
5 changes: 3 additions & 2 deletions lib/src/status.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use std::collections::VecDeque;

use crate::spec::{BootEntry, BootOrder, Host, HostSpec, HostStatus, HostType, ImageStatus};
use crate::spec::{ImageReference, ImageSignature};
use anyhow::{Context, Result};
use camino::Utf8Path;
use fn_error_context::context;
Expand All @@ -14,6 +12,9 @@ use ostree_ext::oci_spec::image::ImageConfiguration;
use ostree_ext::ostree;
use ostree_ext::sysroot::SysrootLock;

use crate::spec::{BootEntry, BootOrder, Host, HostSpec, HostStatus, HostType, ImageStatus};
use crate::spec::{ImageReference, ImageSignature};

impl From<ostree_container::SignatureSource> for ImageSignature {
fn from(sig: ostree_container::SignatureSource) -> Self {
use ostree_container::SignatureSource;
Expand Down

0 comments on commit 5a03760

Please sign in to comment.