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

Direction: Rename from_normalized to new_unchecked #11425

Merged
merged 6 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>
  • Loading branch information
doonv and tguichaoua authored Jan 20, 2024
commit e617811111e6b4aaa601e3e92fe20811bbeda908
3 changes: 1 addition & 2 deletions crates/bevy_math/src/primitives/dim2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ impl Direction2d {
///
/// # Warning
///
/// This function only checks if `value` is normalized on debug builds,
/// release builds can allow the creation of a [`Direction2d`] that is not normalized.
/// `value` must be normalized, i.e it's length must be `1.0`.
pub fn new_unchecked(value: Vec2) -> Self {
debug_assert!(value.is_normalized());

Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_math/src/primitives/dim3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ impl Direction3d {
///
/// # Warning
///
/// This function only checks if `value` is normalized on debug builds,
/// release builds can allow the creation of a [`Direction3d`] that is not normalized.
/// `value` must be normalized, i.e it's length must be `1.0`.
pub fn new_unchecked(value: Vec3) -> Self {
debug_assert!(value.is_normalized());

Expand Down