diff options
Diffstat (limited to 'src/length.rs')
| -rw-r--r-- | src/length.rs | 4 |
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) } } |
