Skip to content

Commit

Permalink
Bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Mar 28, 2024
1 parent 252c7ce commit 4482c08
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 113 deletions.
111 changes: 56 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ rand = "0.8"
rand_distr = "0.4"
regex = "1.8"
sha2 = "0.10.6"
yansi = "0.5"
yansi = "1"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
clap = { version = "4.4", features = ["derive", "cargo", "wrap_help"] }
Expand Down
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ async fn main() -> Result<()> {
use clap::CommandFactory;
use genact::args::AppConfig;

yansi::Paint::enable_windows_ascii();

let appconfig = parse_args();

if let Some(shell) = appconfig.print_completions {
Expand Down
16 changes: 8 additions & 8 deletions src/modules/ansible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ async fn do_for_all_hosts(hosts: &[String], is_gather: bool) {

// If this is the gather task, we always want to return all ok.
let text = if is_gather {
Paint::green(format!("ok: [{host}]")).to_string()
format!("ok: [{host}]").green().to_string()
} else {
match global_outcome {
1 => Paint::cyan(format!("skipping: [{host}]")).to_string(),
2 => Paint::red(format!("failed: [{host}]")).to_string(),
3 => Paint::yellow(format!("changed: [{host}]")).to_string(),
1 => format!("skipping: [{host}]").cyan().to_string(),
2 => format!("failed: [{host}]").red().to_string(),
3 => format!("changed: [{host}]").yellow().to_string(),
_ => match host_outcome {
1 => Paint::cyan(format!("skipping: [{host}]")).to_string(),
2 => Paint::red(format!("failed: [{host}]")).to_string(),
3..=5 => Paint::yellow(format!("changed: [{host}]")).to_string(),
_ => Paint::green(format!("ok: [{host}]")).to_string(),
1 => format!("skipping: [{host}]").cyan().to_string(),
2 => format!("failed: [{host}]").red().to_string(),
3..=5 => format!("changed: [{host}]").yellow().to_string(),
_ => format!("ok: [{host}]").green().to_string(),
},
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/modules/bootlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Module for Bootlog {

let is_error = rng.gen_bool(0.01);
if is_error {
dprint(format!("{}", Paint::red(format!("ERROR: {choice}"))), 10).await;
dprint(format!("{}", format!("ERROR: {choice}").red()), 10).await;
} else {
let has_bold_word = rng.gen_bool(0.1);
if has_bold_word {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/bruteforce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Module for Bruteforce {

// Get the SHA256 string for a str
fn sha256(s: &str) -> String {
let mut hasher = Sha256::new();
let mut hasher = Sha256::default();
hasher.update(s);
let result_bytes = hasher.finalize();
format!("{result_bytes:x}")
Expand Down

0 comments on commit 4482c08

Please sign in to comment.