capstan icon indicating copy to clipboard operation
capstan copied to clipboard

Rust 2021, `clippy` clean, `rustfmt` etc.

Open virtualritz opened this issue 2 years ago • 0 comments

  • Updated to Rust 2021.
  • Bumped all deps to latest versions.
  • Made the crate build with stable Rust using the is_sorted crate. When using the unstable feature the is_sorted crate falls back to using the unstable is_sorted feature. I.e. the crate will then only compile with nightly.
  • Made this a library-only crate. I.e. removed Cargo.lock from git and moved src/main.rs to examples/diagram.rs.
  • Moved everything the crate exports one level up to the root so there is less typing for users.

TODO:

  • Swap deprecated nalgebra::VectorN for one of the alternatives.

no_std

I removed the crate's std depedency as much as possible using resp. traits from core instead (and using thiserror-no-std).

To make this crate truly no_std (i.e. particualrly not require allocations) consider abandoning the OOP approach where a Curve is a struct.

Instead go for one where there are only the functions like de_boor() etc. that take all the required curve data as slices instead of Vec. Curve::new() would be renamed to is_curve_ok().

See e.g. my uniform-cubic-splines crate (which is no_std) for this approach.

virtualritz avatar Feb 23 '23 19:02 virtualritz