Skip to content

Commit

Permalink
Merge pull request #98 from Frederick888/fix-clippy into master
Browse files Browse the repository at this point in the history
* fix-clippy:
  style: Allow dead code on CurrentCaller.pid
  style: Suppress dead code warnings in test builds
  • Loading branch information
Frederick888 committed Aug 12, 2024
2 parents 59d43db + 3ee4b6f commit 0bacb1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ check:

clippy:
for feature in default notification encryption yubikey all; do \
cargo clippy --features=$feature --locked -- -D warnings; \
cargo clippy --features=$feature --locked --tests -- -D warnings; \
done

Expand Down
5 changes: 4 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,13 +766,15 @@ impl MockYubiKeyTrait {
}
}

#[allow(dead_code)]
#[cfg(feature = "yubikey")]
struct YubiKey {
yubi: Yubico,
device: yubico_manager::Device,
}

#[cfg(all(not(test), feature = "yubikey"))]
#[allow(dead_code)]
#[cfg(feature = "yubikey")]
impl YubiKey {
fn new() -> Result<Self> {
let mut yubi = Yubico::new();
Expand All @@ -781,6 +783,7 @@ impl YubiKey {
}
}

#[allow(dead_code)]
#[cfg(feature = "yubikey")]
impl YubiKeyTrait for YubiKey {
fn read_serial_number(&mut self) -> Result<u32, YubicoError> {
Expand Down
1 change: 1 addition & 0 deletions src/utils/callers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use sysinfo::{get_current_pid, ProcessRefreshKind, RefreshKind, System, UpdateKi
#[derive(Debug)]
pub struct CurrentCaller {
pub path: PathBuf,
#[allow(dead_code)]
pub pid: u32,
#[cfg(unix)]
pub uid: u32,
Expand Down

0 comments on commit 0bacb1d

Please sign in to comment.