From dbfb3d2ced91e56314dfabbb4df9a338926c0a7a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 3 Aug 2020 16:01:23 +0200 Subject: =?UTF-8?q?Formatting,=20documentation=20and=20small=20improvement?= =?UTF-8?q?s=20=F0=9F=A7=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/length.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/length.rs') 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::() - .map(|val| Length::new(val, unit)) + .map(|val| Self::new(val, unit)) .map_err(|_| ParseLengthError) } } -- cgit v1.2.3