dimforge / parry

2D and 3D collision-detection library for Rust.
https://parry.rs
Apache License 2.0
556 stars 96 forks source link

Migrate to "use" instead of alias pattern for `Real` #222

Open Vrixyz opened 1 month ago

Vrixyz commented 1 month ago

As a new user opening rapier, it can be overwhelming to see Real used everywhere, rapier uses heavily generic code, so thriving to limit indirection can help.

// This can be gated behind a feature flag for f64 or f32.
use f64 as Real;

pub fn takes_a_real(param: Real) {}
use_pattern_doc

Idea credit to Alice from bevy ; and https://www.reddit.com/r/rust/comments/1e0trid/comment/lcpjwh4.

Vrixyz commented 1 month ago