Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Vrixyz opened this issue Jul 11, 2024 · 1 comment · Fixed by #223
Open

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

Vrixyz opened this issue Jul 11, 2024 · 1 comment · Fixed by #223
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@Vrixyz
Copy link
Contributor

Vrixyz commented Jul 11, 2024

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 Vrixyz transferred this issue from dimforge/rapier Jul 11, 2024
@Vrixyz Vrixyz added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 11, 2024
@Vrixyz Vrixyz changed the title Migrate to "use" instead of newtype pattern for Real Migrate to "use" instead of alias pattern for Real Jul 15, 2024
@Vrixyz Vrixyz reopened this Jul 18, 2024
@Vrixyz
Copy link
Contributor Author

Vrixyz commented Jul 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant