From a64a449da4be7ccb0804541ec45524599ef1d6b6 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Sat, 16 Nov 2024 11:43:38 +0100 Subject: [PATCH] lib8: change saturating_add to use by-value instead of by-ref --- src/lib8.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib8.rs b/src/lib8.rs index 5b2bb3f..6ee343d 100644 --- a/src/lib8.rs +++ b/src/lib8.rs @@ -3,11 +3,11 @@ use palette::encoding::srgb::Srgb; use rgb::RGB8; pub trait Rgb8Blend { - fn saturating_add(&self, b: Self) -> Self; + fn saturating_add(self, b: Self) -> Self; } impl Rgb8Blend for RGB8 { - fn saturating_add(&self, b: Self) -> Self { + fn saturating_add(self, b: Self) -> Self { RGB8::new(self.r.saturating_add(b.r), self.g.saturating_add(b.g), self.b.saturating_add(b.b)) } }