Skip to content

Commit

Permalink
chore: updated
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <[email protected]>
  • Loading branch information
AlexsJones committed Oct 28, 2023
1 parent 05debe8 commit c915d66
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/analyze/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub async fn run_analysis(args: &Args) {

match &args.analyzer {
Some(analyzer_arg) => {
let filtered_analyzer = analyzers.iter().find(|x| x.get_name() == analyzer_arg);
let filtered_analyzer = analyzers.iter().find(|x| x.get_name().as_str() == analyzer_arg);
match filtered_analyzer {
Some(x) => {
let thread_tx = tx.clone();
Expand Down
10 changes: 5 additions & 5 deletions src/analyzer/s3_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use aws_sdk_s3;
use colored::Colorize;
use std::sync::Arc;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use serde_json::{Value};

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -70,7 +70,7 @@ impl analyzer_trait::Analyzer for S3Analyzer {
);
let mut results = vec![AnalysisResults {
message: "".to_string(),
analyzer_name: self.get_name().
analyzer_name: self.get_name()
}];

let s3 = aws_sdk_s3::Client::new(&self.config);
Expand Down Expand Up @@ -113,10 +113,10 @@ impl analyzer_trait::Analyzer for S3Analyzer {
}
}
},
Err(e) => ()
Err(_e) => ()
}
}
Err(err) => ()
Err(_err) => ()
}
}
}
Expand All @@ -125,6 +125,6 @@ impl analyzer_trait::Analyzer for S3Analyzer {
}

fn get_name(&self) -> String {
"s3".to_string()
"S3".to_string()
}
}
2 changes: 1 addition & 1 deletion src/analyzer/sts_analyzer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::analyzer::analyzer_trait;
use crate::analyzer::types::AnalysisResults;
use crate::utils;

use async_trait::async_trait;
use aws_sdk_iam;
use colored::Colorize;
Expand Down
3 changes: 2 additions & 1 deletion src/outputs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use colored::Colorize;
use crate::analyzer::types::AnalysisResults;

pub struct Processor {
Expand Down Expand Up @@ -30,7 +31,7 @@ impl Processor {
}
fn print_text(&self) {
for elem in self.analysis_results.iter().filter(|&x| !x.message.is_empty()) {
println!("{}", elem.message);
println!("{}:{}", elem.analyzer_name.blue(),elem.message.green());
}
}

Expand Down

0 comments on commit c915d66

Please sign in to comment.