assert default values

This commit is contained in:
Simon Gardling 2022-03-28 08:42:33 -04:00
parent 6e281e0569
commit 583fb0e9c9
4 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,7 @@ ruzstd = { git = "https://github.com/KillingSpark/zstd-rs.git" }
serde_json = "1.0.79"
tracing = "0.1.32"
itertools = "0.10.3"
static_assertions = "1.1.0"
[build-dependencies]
shadow-rs = "0.11.0"

View File

@ -24,6 +24,9 @@ pub const INTEGRAL_X_MIN: f64 = -1000.0;
/// Maximum X value for calculating an Integral
pub const INTEGRAL_X_MAX: f64 = 1000.0;
const_assert!(INTEGRAL_X_MAX > INTEGRAL_X_MIN);
/// Range of acceptable x coordinates for calculating an integral
pub const INTEGRAL_X_RANGE: RangeInclusive<f64> = INTEGRAL_X_MIN..=INTEGRAL_X_MAX;
@ -39,5 +42,7 @@ pub const DEFAULT_MIN_X: f64 = -10.0;
pub const DEFAULT_MAX_X: f64 = 10.0;
const_assert!(DEFAULT_MAX_X > DEFAULT_MIN_X);
/// Default number of integral boxes
pub const DEFAULT_INTEGRAL_NUM: usize = 100;

View File

@ -1,6 +1,9 @@
#![allow(clippy::unused_unit)] // Fixes clippy keep complaining about wasm_bindgen
#![feature(const_mut_refs)]
#[macro_use]
extern crate static_assertions;
mod consts;
mod egui_app;
mod function;

View File

@ -1,5 +1,8 @@
#![feature(const_mut_refs)]
#[macro_use]
extern crate static_assertions;
mod consts;
mod egui_app;
mod function;