From 63f6b61f9199a3ba43058840c8f344b2d76d1f2f Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sun, 13 Aug 2023 22:18:15 -0700 Subject: [PATCH] Use Self for SVGMeasure operation implementations --- dyesub-tool/src/svg/measure.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dyesub-tool/src/svg/measure.rs b/dyesub-tool/src/svg/measure.rs index 1fb1398..f16b4b4 100644 --- a/dyesub-tool/src/svg/measure.rs +++ b/dyesub-tool/src/svg/measure.rs @@ -25,7 +25,7 @@ impl Display for SVGMeasure { impl Add for SVGMeasure { type Output = Self; - fn add(self, other: SVGMeasure) -> SVGMeasure { + fn add(self, other: Self) -> Self { SVGMeasure::new(self.measure + other.measure, self.unit) } } @@ -33,7 +33,7 @@ impl Add for SVGMeasure { impl Sub for SVGMeasure { type Output = Self; - fn sub(self, other: SVGMeasure) -> SVGMeasure { + fn sub(self, other: Self) -> Self { SVGMeasure::new(self.measure - other.measure, self.unit) } } @@ -41,7 +41,7 @@ impl Sub for SVGMeasure { impl Mul for SVGMeasure { type Output = Self; - fn mul(self, scalar: f64) -> SVGMeasure { + fn mul(self, scalar: f64) -> Self { SVGMeasure::new(self.measure * scalar, self.unit) } } @@ -49,7 +49,7 @@ impl Mul for SVGMeasure { impl Div for SVGMeasure { type Output = Self; - fn div(self, scalar: f64) -> SVGMeasure { + fn div(self, scalar: f64) -> Self { SVGMeasure::new(self.measure / scalar, self.unit) } }