Skip to content

Commit

Permalink
chore: more clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed Mar 29, 2024
1 parent be5dd32 commit 734c090
Show file tree
Hide file tree
Showing 7 changed files with 638 additions and 619 deletions.
17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ nightly = []
# for tests only
as-root = []

[lints.rust]
missing_docs = "warn"
unsafe_code = "forbid"

[lints.clippy]
clone_on_ref_ptr = "warn"
dbg_macro = "warn"
format_push_string = "warn"
if_then_some_else_none = "warn"
multiple_inherent_impl = "warn"
ref_patterns = "warn"
semicolon_inside_block = "warn"
str_to_string = "warn"
string_to_string = "warn"
unneeded_field_pattern = "warn"
verbose_file_reads = "warn"

[package.metadata.deb]
name = "shh"
depends = "$auto, strace"
1 change: 1 addition & 0 deletions src/cl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::path::PathBuf;

use clap::Parser;

/// Command line arguments
#[derive(Parser, Debug)]
pub struct Args {
#[command(subcommand)]
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Systemd Hardening Helper
#![cfg_attr(all(feature = "nightly", test), feature(test))]

use std::{
Expand Down Expand Up @@ -42,7 +44,7 @@ fn main() -> anyhow::Result<()> {
let strace_version = strace::StraceVersion::local_system()?;
log::info!("Detected versions: Systemd {sd_version}, Linux kernel {kernel_version}, strace {strace_version}");
if strace_version < strace::StraceVersion::new(6, 4) {
log::warn!("Strace version >=6.4 is strongly recommended, if you experience strace output parsing errors, please consider upgrading")
log::warn!("Strace version >=6.4 is strongly recommended, if you experience strace output parsing errors, please consider upgrading");
}

// Parse cl args
Expand Down Expand Up @@ -145,7 +147,7 @@ fn main() -> anyhow::Result<()> {
"Resolved systemd options: {}",
resolved_opts
.iter()
.map(|o| format!("{}", o))
.map(|o| format!("{o}"))
.collect::<Vec<_>>()
.join(", ")
);
Expand Down
Loading

0 comments on commit 734c090

Please sign in to comment.