From 4482c08d3ec18dc7d070c06412b0fc2f249e76f2 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Thu, 28 Mar 2024 01:37:13 +0100 Subject: [PATCH] Bump deps --- Cargo.lock | 111 ++++++++++++++++++------------------ Cargo.toml | 2 +- src/main.rs | 2 - src/modules/ansible.rs | 16 +++--- src/modules/bootlog.rs | 2 +- src/modules/bruteforce.rs | 2 +- src/modules/cryptomining.rs | 7 ++- src/modules/julia.rs | 68 +++++++++++----------- src/modules/rkhunter.rs | 10 ++-- src/modules/simcity.rs | 2 +- 10 files changed, 109 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f31f8efc..7277540d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -123,8 +123,8 @@ dependencies = [ "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand 2.0.2", + "futures-lite 2.3.0", "slab", ] @@ -139,7 +139,7 @@ dependencies = [ "async-io 2.3.2", "async-lock 3.3.0", "blocking", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "once_cell", ] @@ -173,10 +173,10 @@ dependencies = [ "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "parking", - "polling 3.5.0", - "rustix 0.38.31", + "polling 3.6.0", + "rustix 0.38.32", "slab", "tracing", "windows-sys 0.52.0", @@ -237,13 +237,13 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -254,9 +254,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "bitflags" @@ -266,9 +266,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -288,9 +288,9 @@ dependencies = [ "async-channel 2.2.0", "async-lock 3.3.0", "async-task", - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "piper", "tracing", ] @@ -321,9 +321,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" dependencies = [ "android-tzdata", "iana-time-zone", @@ -335,9 +335,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.2" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -367,14 +367,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -573,9 +573,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "form_urlencoded" @@ -624,11 +624,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-core", "futures-io", "parking", @@ -706,9 +706,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -846,9 +846,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "nix" @@ -856,7 +856,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "cfg_aliases", "libc", @@ -920,7 +920,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -951,7 +951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-io", ] @@ -973,14 +973,15 @@ dependencies = [ [[package]] name = "polling" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", - "rustix 0.38.31", + "rustix 0.38.32", "tracing", "windows-sys 0.52.0", ] @@ -1057,9 +1058,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1080,9 +1081,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "roff" @@ -1106,11 +1107,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys 0.4.13", @@ -1172,9 +1173,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", @@ -1187,7 +1188,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.31", + "rustix 0.38.32", "windows-sys 0.48.0", ] @@ -1268,9 +1269,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "value-bag" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec26a25bd6fca441cdd0f769fd7f891bae119f996de31f86a5eddccef54c1d" +checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" [[package]] name = "version_check" @@ -1311,7 +1312,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", "wasm-bindgen-shared", ] @@ -1345,7 +1346,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1531,6 +1532,6 @@ checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" diff --git a/Cargo.toml b/Cargo.toml index dd299c94b..0caa3c942 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/src/main.rs b/src/main.rs index 6ca26728e..f404c3fcd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 { diff --git a/src/modules/ansible.rs b/src/modules/ansible.rs index f1866ed17..d9ca1e688 100644 --- a/src/modules/ansible.rs +++ b/src/modules/ansible.rs @@ -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(), }, } }; diff --git a/src/modules/bootlog.rs b/src/modules/bootlog.rs index 9690eb1fe..0dea2588f 100644 --- a/src/modules/bootlog.rs +++ b/src/modules/bootlog.rs @@ -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 { diff --git a/src/modules/bruteforce.rs b/src/modules/bruteforce.rs index f9add6aa8..0c96c2b1e 100644 --- a/src/modules/bruteforce.rs +++ b/src/modules/bruteforce.rs @@ -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}") diff --git a/src/modules/cryptomining.rs b/src/modules/cryptomining.rs index 588228bac..a55aa3d51 100644 --- a/src/modules/cryptomining.rs +++ b/src/modules/cryptomining.rs @@ -49,7 +49,8 @@ impl Module for Crytomining { for _ in 1..num_lines { let sleep_length = 300; - let time = Paint::magenta(Local::now().format("%H:%M:%S")); + let time = Local::now().format("%H:%M:%S"); + let time = time.magenta(); if remaining_until_new_job == 0 { remaining_until_new_job = new_job_every_n_lines; @@ -108,11 +109,11 @@ impl Module for Crytomining { gpus.push_str(&format!( "gpu/{gpu} {mhs:.2} ", gpu = gpu, - mhs = Paint::cyan(actual_mhs_per_gpu) + mhs = actual_mhs_per_gpu.cyan() )); total_mhs += actual_mhs_per_gpu; } - let speed = format!("Speed {mhs:>6.2} Mh/s", mhs = Paint::cyan(total_mhs).bold()); + let speed = format!("Speed {mhs:>6.2} Mh/s", mhs = total_mhs.cyan().bold()); let duration = Duration::from_std(now.elapsed()) .expect("Couldn't make chrono::Duration from std::time::Duration!"); let elapsed = format!( diff --git a/src/modules/julia.rs b/src/modules/julia.rs index dd7843c47..47fea1230 100644 --- a/src/modules/julia.rs +++ b/src/modules/julia.rs @@ -155,15 +155,11 @@ async fn print_julia_prompt() { } async fn print_pkg_prompt(project: &str) { - print(format!( - "{} ", - Paint::blue(format!("({project}) pkg>")).bold() - )) - .await; + print(format!("{} ", format!("({project}) pkg>").blue().bold())).await; } async fn log_action(action: impl Display, message: impl Display) { - print(format!("{:>12} {}", Paint::green(action).bold(), message)).await; + print(format!("{:>12} {}", action.green().bold(), message)).await; newline().await; } @@ -285,31 +281,31 @@ async fn print_old_manifest_format_before(manifest_path: &str) { .await; newline().await; print(format!( - "{} To update to the new format run `Pkg.upgrade_manifest()` which will upgrade the format without re-resolving.", - Paint::yellow("│").bold() + "{} To update to the new format run `Pkg.upgrade_manifest()` which will upgrade the format without re-resolving.", + Paint::yellow("│").bold() )) - .await; + .await; newline().await; print(format!( - "{} {}", - Paint::yellow("└").bold(), - Paint::fixed(8, "@ Pkg.Types /builddir/build/BUILD/julia-1.7.3/build/usr/share/julia/stdlib/v1.7/Pkg/src/manifest.jl:287") + "{} {}", + "└".yellow().bold(), + "@ Pkg.Types /builddir/build/BUILD/julia-1.7.3/build/usr/share/julia/stdlib/v1.7/Pkg/src/manifest.jl:287".fixed(8) )) - .await; + .await; newline().await; } async fn print_old_manifest_format_after(manifest_path: &str) { print(format!( - "{} The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version.", - Paint::yellow("┌ Warning:").bold(), + "{} The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version.", + Paint::yellow("┌ Warning:").bold(), )) - .await; + .await; newline().await; print(format!( "{} {}", - Paint::yellow("└").bold(), - Paint::fixed(8, format!("@ {manifest_path}:0")) + "└".yellow().bold(), + format!("@ {manifest_path}:0").fixed(8) )) .await; newline().await; @@ -323,16 +319,14 @@ async fn report_packages(packages: &[&Package<'_>]) { // update package print(format!( " {} {}", - Paint::fixed(8, format!("[{}]", &package.id[0..8])), - Paint::fixed( - 11, // bright yellow - format!( - "↑ {} v{} ⇒ v{}", - package.name, - package.versions[rng.gen_range(0..package.versions.len() - 1)], - package.versions.last().unwrap() - ) + format!("[{}]", &package.id[0..8]).fixed(8), + format!( + "↑ {} v{} ⇒ v{}", + package.name, + package.versions[rng.gen_range(0..package.versions.len() - 1)], + package.versions.last().unwrap() ) + .fixed(11) )) .await; newline().await; @@ -340,10 +334,11 @@ async fn report_packages(packages: &[&Package<'_>]) { // add package print(format!( " {} {}", - Paint::fixed(8, format!("[{}]", &package.id[0..8])), - Paint::fixed( - 10, // bright green - format!("+ {} v{}", package.name, package.versions.last().unwrap()) + format!("[{}]", &package.id[0..8]).fixed(8), + format!( + "+ {} v{}", + package.name, + package.versions.last().unwrap().fixed(10) ) )) .await; @@ -352,10 +347,11 @@ async fn report_packages(packages: &[&Package<'_>]) { // remove package print(format!( " {} {}", - Paint::fixed(8, format!("[{}]", &package.id[0..8])), - Paint::fixed( - 9, // bright red - format!("- {} v{}", package.name, package.versions.last().unwrap()) + format!("[{}]", &package.id[0..8]).fixed(8), + format!( + "- {} v{}", + package.name, + package.versions.last().unwrap().fixed(9) ) )) .await; @@ -448,7 +444,7 @@ async fn precompile(packages: &[&Package<'_>]) { print(format!( " {num_packages} dependencies successfully precompiled in {seconds:.0} seconds ({} already precompiled)", rng.gen_range(10..500) - )) + )) .await; newline().await; } diff --git a/src/modules/rkhunter.rs b/src/modules/rkhunter.rs index 03833f939..c68dc9511 100644 --- a/src/modules/rkhunter.rs +++ b/src/modules/rkhunter.rs @@ -110,12 +110,12 @@ impl Module for RkHunter { // Prepare check and status let mut check_status = if check_positive { - Paint::red("Found") + "Found".red() } else { - Paint::default("Not found") + "Not found".resetting() }; if rng.gen_bool(0.01) { - check_status = Paint::default("Skipped"); + check_status = "Skipped".resetting(); } print(format!( @@ -129,9 +129,9 @@ impl Module for RkHunter { print(format!( " {rootkit: