Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup clippy lints #390

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes I will have to try to remember this one. Maybe we can drop the helper closure even and just inline it in the two uses.

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
Loading