Skip to content

Commit

Permalink
Cleanup clippy lints
Browse files Browse the repository at this point in the history
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
  • Loading branch information
jeckersb committed Mar 12, 2024
1 parent e793d84 commit 1ea5df7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,8 @@ pub(crate) async fn prepare_for_write() -> Result<()> {
);
}
ensure_self_unshared_mount_namespace().await?;
if crate::lsm::selinux_enabled()? {
if !crate::lsm::selinux_ensure_install()? {
tracing::warn!("Do not have install_t capabilities");
}
if crate::lsm::selinux_enabled()? && !crate::lsm::selinux_ensure_install()? {
tracing::warn!("Do not have install_t capabilities");
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ struct RootMountInfo {
/// Discover how to mount the root filesystem, using existing kernel arguments and information
/// about the root mount.
fn find_root_args_to_inherit(cmdline: &[&str], root_info: &Filesystem) -> Result<RootMountInfo> {
let cmdline = || cmdline.iter().map(|&s| s);
let cmdline = || cmdline.iter().copied();
let root = crate::kernel::find_first_cmdline_arg(cmdline(), "root");
// If we have a root= karg, then use that
let (mount_spec, kargs) = if let Some(root) = root {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/install/baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ pub(crate) fn install_create_rootfs(
let bootsrc = format!("UUID={boot_uuid}");
let bootarg = format!("boot={bootsrc}");
let boot = MountSpec {
source: bootsrc.into(),
source: bootsrc,
target: "/boot".into(),
fstype: MountSpec::AUTO.into(),
options: Some("ro".into()),
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn man2markdown(sh: &Shell) -> Result<()> {
fn git_timestamp(sh: &Shell) -> Result<String> {
let ts = cmd!(sh, "git show -s --format=%ct").read()?;
let ts = ts.trim().parse::<i64>()?;
let ts = chrono::NaiveDateTime::from_timestamp_opt(ts, 0)
let ts = chrono::DateTime::from_timestamp(ts, 0)
.ok_or_else(|| anyhow::anyhow!("Failed to parse timestamp"))?;
Ok(ts.format("%Y%m%d%H%M").to_string())
}
Expand Down

0 comments on commit 1ea5df7

Please sign in to comment.