added skip system info flag, and ran clippy

This commit is contained in:
2026-03-24 16:40:03 +01:00
parent 03b1b54299
commit 88806c8822
4 changed files with 19 additions and 13 deletions

View File

@@ -125,7 +125,7 @@ pub fn calculate_primes(range_start: u64, range_end: u64) -> u64 {
current_number = 3;
}
if current_number % 2 == 0 {
if current_number.is_multiple_of(2) {
current_number += 1;
}
@@ -147,7 +147,7 @@ pub fn is_number_prime(number: u64) -> bool {
let search_limit = (number as f64).sqrt() as u64;
for i in (3..=search_limit).step_by(2) {
if number % i == 0 {
if number.is_multiple_of(i) {
return false;
}
}

View File

@@ -4,7 +4,7 @@ pub mod benchmark;
pub mod slimes;
pub fn application_header() -> &'static str {
let ascii_art = r#"
r#"
.---.
.' '. < CPU SLIME >
/ ^ ^ \
@@ -12,7 +12,7 @@ pub fn application_header() -> &'static str {
| |
\ /
'._____.'
"#;
// println!("{}", ascii_art.bright_green().bold());
ascii_art
"#
// .bright_green()
// .bold()
}

View File

@@ -15,6 +15,10 @@ pub struct Cli {
#[arg(short, long)]
pub skip_benchmark: bool,
/// Skil system info
#[arg(short = 'S', long)]
pub skip_system_info: bool,
/// Benchmark: Upper limit for prime calculation (higher number = longer test)
#[arg(short, long, default_value_t = 500_000)]
pub prime_limit: u64,
@@ -34,6 +38,7 @@ fn main() {
println!("{}", application_header().bright_blue());
if !cli.skip_system_info {
let slimes = get_all_slimes();
let mut sys = System::new_all();
@@ -43,6 +48,7 @@ fn main() {
slime.print(&sys);
}
println!();
}
if !cli.skip_benchmark {
let logical_core_count = match cli.jobs {

View File

@@ -17,7 +17,7 @@ pub trait Slime {
format!("{}:", self.label()).bold().color(self.color())
);
} else {
print!("{} {:<10} ", " ", " ");
print!(" {:<10} ", " ");
}
println!("{}", val.white());
}