summaryrefslogtreecommitdiff
path: root/src/geom/length.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-05-27 14:48:45 +0200
committerLaurenz <laurmaedje@gmail.com>2021-05-27 14:48:45 +0200
commitb886ced40825372000df0fa9cddff98a1b642cc6 (patch)
tree6baf23b24c90352f3712f0e8eda57decf913181a /src/geom/length.rs
parent9e0a34c80f2fa48ada3a0ed0c985c8daa2ae7de3 (diff)
Switch to N64 type alias
Diffstat (limited to 'src/geom/length.rs')
-rw-r--r--src/geom/length.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/geom/length.rs b/src/geom/length.rs
index 2439000c..e9ba0853 100644
--- a/src/geom/length.rs
+++ b/src/geom/length.rs
@@ -1,4 +1,4 @@
-use decorum::NotNan;
+use decorum::N64;
use serde::{Deserialize, Serialize};
use super::*;
@@ -9,13 +9,13 @@ use super::*;
#[serde(transparent)]
pub struct Length {
/// The length in raw units.
- raw: NotNan<f64>,
+ raw: N64,
}
impl Length {
/// The zero length.
pub fn zero() -> Self {
- Self { raw: 0.0.into() }
+ Self { raw: N64::from(0.0) }
}
/// Create a length from a number of points.
@@ -40,7 +40,7 @@ impl Length {
/// Create a length from a number of raw units.
pub fn raw(raw: f64) -> Self {
- Self { raw: raw.into() }
+ Self { raw: N64::from(raw) }
}
/// Convert this to a number of points.
@@ -70,7 +70,7 @@ impl Length {
/// Create a length from a value in a unit.
pub fn with_unit(val: f64, unit: LengthUnit) -> Self {
- Self { raw: (val * unit.raw_scale()).into() }
+ Self { raw: N64::from(val * unit.raw_scale()) }
}
/// Get the value of this length in unit.