diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e2c19e6..4553415 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,11 +12,9 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - - name: Install nextest - shell: bash - run: | - curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin + - uses: taiki-e/install-action@nextest - run: cargo fmt --all --check - run: cargo check --workspace - run: cargo clippy --all-targets --all-features -- -D warnings - - run: cargo nextest run -E 'all() - package(calendar)' \ No newline at end of file + - run: cargo nextest run -E 'all() - package(calendar)' + - run: cargo test --doc \ No newline at end of file diff --git a/crates/qlab-math/src/interpolation/linear.rs b/crates/qlab-math/src/interpolation/linear.rs index 7704c6d..f237585 100644 --- a/crates/qlab-math/src/interpolation/linear.rs +++ b/crates/qlab-math/src/interpolation/linear.rs @@ -15,11 +15,8 @@ use qlab_error::InterpolationError; /// use qlab_math::interpolation::linear::Linear; /// use qlab_math::interpolation::Interpolator; /// -/// let mut linear: Linear = Linear::default(); -/// /// let xs_and_ys: [(f32, f32); 2] = [(1.0_f32, 2.0_f32), (3.0_f32, 4.0_f32)]; -/// -/// linear.try_fit(&xs_and_ys).unwrap(); +/// let linear = Linear::default().try_fit(&xs_and_ys).unwrap(); /// assert_eq!(linear.try_value(2.0).unwrap(), 3.0); /// /// ``` diff --git a/crates/qlab-math/src/interpolation/spline.rs b/crates/qlab-math/src/interpolation/spline.rs index d110b09..cc3377f 100644 --- a/crates/qlab-math/src/interpolation/spline.rs +++ b/crates/qlab-math/src/interpolation/spline.rs @@ -3,7 +3,3 @@ use crate::value::Value; pub mod catmull_rom; pub mod hermite; pub mod natural_cubic; - -impl Value for f32 {} - -impl Value for f64 {} diff --git a/crates/qlab-math/src/value.rs b/crates/qlab-math/src/value.rs index fca77df..225c8d9 100644 --- a/crates/qlab-math/src/value.rs +++ b/crates/qlab-math/src/value.rs @@ -20,3 +20,7 @@ pub trait Value: + Default { } + +impl Value for f32 {} + +impl Value for f64 {}