Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
LeChatP committed Aug 30, 2023
1 parent b0efffd commit e9b2d3d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/sr/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use nix::{
use pam_client::{conv_cli::Conversation, Context, Flag};
#[cfg(not(debug_assertions))]
use std::panic::set_hook;
use tracing::{debug, Level, error};
use tracing::{debug, error, Level};
use tracing_subscriber::util::SubscriberInitExt;

#[derive(Parser, Debug)]

Check warning on line 28 in src/sr/main.rs

View check run for this annotation

Codecov / codecov/patch

src/sr/main.rs#L28

Added line #L28 was not covered by tests
Expand Down Expand Up @@ -143,7 +143,6 @@ fn filter_env_vars(env: Vars, checklist: &[&str], whitelist: &[&str]) -> HashMap

#[cfg(debug_assertions)]
fn subsribe() {

let identity = std::ffi::CStr::from_bytes_with_nul(b"sr\0").unwrap();
let options = syslog_tracing::Options::LOG_PID;
let facility = syslog_tracing::Facility::Auth;
Expand Down Expand Up @@ -260,15 +259,13 @@ fn main() {
.expect("Failed to add cookie");
dac_override_effective(false).expect("Failed to dac_override_effective");
let matching = match args.role {
None => match config
.matches(&user, &args.command) {
Err(err) => {
error!("Permission Denied");
std::process::exit(1);
},
Ok(matching) => matching,
}
,
None => match config.matches(&user, &args.command) {
Err(err) => {

Check warning on line 263 in src/sr/main.rs

View workflow job for this annotation

GitHub Actions / clippy

unused variable: `err`

warning: unused variable: `err` --> src/sr/main.rs:263:17 | 263 | Err(err) => { | ^^^ help: if this is intentional, prefix it with an underscore: `_err` | = note: `#[warn(unused_variables)]` on by default
error!("Permission Denied");
std::process::exit(1);

Check warning on line 265 in src/sr/main.rs

View check run for this annotation

Codecov / codecov/patch

src/sr/main.rs#L240-L265

Added lines #L240 - L265 were not covered by tests
}
Ok(matching) => matching,

Check warning on line 267 in src/sr/main.rs

View check run for this annotation

Codecov / codecov/patch

src/sr/main.rs#L267

Added line #L267 was not covered by tests
},
Some(role) => config
.as_ref()
.borrow()
Expand Down

0 comments on commit e9b2d3d

Please sign in to comment.