Skip to content

Commit

Permalink
cargo clippy & fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuminn committed Jul 23, 2024
1 parent 1200499 commit 47abba4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/detections/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use crate::options::pivot::PIVOT_KEYWORD;
use crate::options::profile::{load_profile, Profile};
use aho_corasick::{AhoCorasick, AhoCorasickBuilder, MatchKind};
use chrono::{DateTime, Days, Duration, Local, Months, Utc};
use clap::{ValueHint, ArgAction, ArgGroup, Args, ColorChoice, Command, CommandFactory, Parser, Subcommand};
use clap::{
ArgAction, ArgGroup, Args, ColorChoice, Command, CommandFactory, Parser, Subcommand, ValueHint,
};
use compact_str::CompactString;
use hashbrown::{HashMap, HashSet};
use itertools::Itertools;
Expand Down Expand Up @@ -887,7 +889,7 @@ pub enum Action {
ListProfiles(CommonOptions),

#[clap(display_order = 383)]
/// Make the auto complete
/// Make the auto complete
AutoComplete(AutoCompleteOptions),

#[clap(
Expand Down Expand Up @@ -988,7 +990,7 @@ pub struct DetectCommonOption {
default_value = "./rules/config",
hide_default_value = true,
value_name = "DIR",
display_order = 442,
display_order = 442,
value_hint(ValueHint::FilePath))]
pub config: PathBuf,

Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ use tokio::task::JoinHandle;
use hayabusa::afterfact::{self, AfterfactInfo, AfterfactWriter};
use hayabusa::debug::checkpoint_process_timer::CHECKPOINT;
use hayabusa::detections::configs::{
load_pivot_keywords, Action, ConfigReader, EventKeyAliasConfig, StoredStatic, TargetEventTime, TargetIds, CURRENT_EXE_PATH, STORED_EKEY_ALIAS, STORED_STATIC
load_pivot_keywords, Action, ConfigReader, EventKeyAliasConfig, StoredStatic, TargetEventTime,
TargetIds, CURRENT_EXE_PATH, STORED_EKEY_ALIAS, STORED_STATIC,
};
use hayabusa::detections::detection::{self, EvtxRecordInfo};
use hayabusa::detections::message::{AlertMessage, DetectInfo, ERROR_LOG_STACK};
Expand Down
10 changes: 7 additions & 3 deletions src/options/auto_complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn auto_complete(app: &mut clap::Command, output_path: Option<&PathBuf>) {
}

fn select_shell() -> Shell {
let items:Vec<Shell> = vec![Shell::Bash, Shell::Elvish, Shell::Fish, Shell::PowerShell];
let items: Vec<Shell> = vec![Shell::Bash, Shell::Elvish, Shell::Fish, Shell::PowerShell];

let selection = Select::new()
.with_prompt("Which shell are you using?")
Expand All @@ -19,12 +19,16 @@ fn select_shell() -> Shell {

items[selection]
}
fn print_completer<G: Generator>(generator: G, app: &mut clap::Command, output_path: Option<&PathBuf>) {
fn print_completer<G: Generator>(
generator: G,
app: &mut clap::Command,
output_path: Option<&PathBuf>,
) {
let mut name = "auto-complete".to_string();
if output_path.is_some() {
name = output_path.unwrap().to_str().unwrap().to_string();
}
let out_dir: PathBuf = env::current_dir().expect("can't get current directory");

let _ = generate_to(generator, app, name, out_dir);
}
}
2 changes: 1 addition & 1 deletion src/options/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod auto_complete;
pub mod geoip_search;
pub mod htmlreport;
pub mod level_tuning;
pub mod pivot;
pub mod profile;
pub mod update;
pub mod auto_complete;

0 comments on commit 47abba4

Please sign in to comment.