Use Self for SVGMeasure operation implementations

main
Elnu 1 year ago
parent 7c27f869c9
commit 63f6b61f91

@ -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<f64> 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<f64> for SVGMeasure {
impl Div<f64> for SVGMeasure {
type Output = Self;
fn div(self, scalar: f64) -> SVGMeasure {
fn div(self, scalar: f64) -> Self {
SVGMeasure::new(self.measure / scalar, self.unit)
}
}

Loading…
Cancel
Save