update README + force user to use unsafe_mode on unsafe usage
All checks were successful
CI / Rust project (push) Successful in 1m51s

This commit is contained in:
fabolous005 2023-11-26 20:46:52 +01:00
parent 83b80c847b
commit c69eac05c4
3 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,14 @@
# incfunc # incfunc
Incrementally Draw derivation function of deriviation function of function Incrementally Draw derivation function of deriviation function of function
## Usage
Usage: incfunc [OPTIONS]
Options:
-o <OPT_LEVEL> Optimization level [default: 3]
-c <CORES> Number of cores [default: max]
--unsafe-mode Unsave mode (Advanced)
-h, --help Print help

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 KiB

After

Width:  |  Height:  |  Size: 765 KiB

View File

@ -15,7 +15,11 @@ struct Args {
/// Number of cores [default: max] /// Number of cores [default: max]
#[arg(short, value_name = "CORES")] #[arg(short, value_name = "CORES")]
core: Option<u8> core: Option<u8>,
/// Unsave mode (Advanced)
#[arg(long, default_value_t = false)]
unsafe_mode: bool
} }
@ -34,6 +38,13 @@ fn main() {
// // points.push(-(i as f64 / 10000.0)); // // points.push(-(i as f64 / 10000.0));
// } // }
if args.opt_level > 8 {
if ! args.unsafe_mode {
panic!("WARNING: This will use at least 30GB RAM\nMake sure you want to use this, then enable save mode");
} else {
println!("WARNING: This will use at least 30GB RAM\nMake sure you want to use this");
}
}
let mut step = "0.".to_string(); let mut step = "0.".to_string();
for _ in 0..args.opt_level { for _ in 0..args.opt_level {
step.push('0') step.push('0')