summaryrefslogtreecommitdiff
path: root/src/length.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-03 16:01:23 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-03 16:04:55 +0200
commitdbfb3d2ced91e56314dfabbb4df9a338926c0a7a (patch)
tree678264cb18f8abc81ebe28077f5aef2df4e5a4bd /src/length.rs
parent5a8f2fb73ddafba9fdbe952385ae2676126183ae (diff)
Formatting, documentation and small improvements 🧽
Diffstat (limited to 'src/length.rs')
-rw-r--r--src/length.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/length.rs b/src/length.rs
index 8e07a8e6..5634da19 100644
--- a/src/length.rs
+++ b/src/length.rs
@@ -84,7 +84,7 @@ impl Length {
}
/// Convert this to a length with a different unit.
- pub fn with_unit(self, unit: Unit) -> Length {
+ pub fn with_unit(self, unit: Unit) -> Self {
Self {
val: self.val * self.unit.raw_scale() / unit.raw_scale(),
unit,
@@ -160,7 +160,7 @@ impl FromStr for Length {
src[..split]
.parse::<f64>()
- .map(|val| Length::new(val, unit))
+ .map(|val| Self::new(val, unit))
.map_err(|_| ParseLengthError)
}
}