Skip to content

Commit

Permalink
Rename Float trait to FloatExt
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-blackbird committed Oct 10, 2023
1 parent 16e405a commit 48dceaf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions codegen/templates/float.rs.tera
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Generated from {{template_path}} template. Edit the template, not the generated file.

use crate::float::Float;
use crate::float::FloatExt;

impl Float for {{ scalar_t }} {
impl FloatExt for {{ scalar_t }} {
#[inline]
fn lerp(self, rhs: {{ scalar_t }}, t: {{ scalar_t }}) -> {{ scalar_t }} {
self + (rhs - self) * t
Expand Down
4 changes: 2 additions & 2 deletions src/f32/float.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Generated from float.rs.tera template. Edit the template, not the generated file.

use crate::float::Float;
use crate::float::FloatExt;

impl Float for f32 {
impl FloatExt for f32 {
#[inline]
fn lerp(self, rhs: f32, t: f32) -> f32 {
self + (rhs - self) * t
Expand Down
4 changes: 2 additions & 2 deletions src/f64/float.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Generated from float.rs.tera template. Edit the template, not the generated file.

use crate::float::Float;
use crate::float::FloatExt;

impl Float for f64 {
impl FloatExt for f64 {
#[inline]
fn lerp(self, rhs: f64, t: f64) -> f64 {
self + (rhs - self) * t
Expand Down
2 changes: 1 addition & 1 deletion src/float.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// A trait for extending [`prim@f32`] and [`prim@f64`] with extra methods.
pub trait Float {
pub trait FloatExt {
/// Performs a linear interpolation between `self` and `rhs` based on the value `t`.
///
/// When `t` is `0`, the result will be `self`. When `t` is `1`, the result
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,4 @@ pub use euler::EulerRot;

/** A trait for extending [`prim@f32`] and [`prim@f64`] with extra methods. */
mod float;
pub use float::Float;
pub use float::FloatExt;
4 changes: 2 additions & 2 deletions tests/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ macro_rules! impl_float_tests {
}

mod float32 {
use glam::Float;
use glam::FloatExt;

impl_float_tests!(f32);
}

mod float64 {
use glam::Float;
use glam::FloatExt;

impl_float_tests!(f64);
}

0 comments on commit 48dceaf

Please sign in to comment.