[librsvg: 11/16] clippy: unsigned_abs() before casting to unsigned
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 11/16] clippy: unsigned_abs() before casting to unsigned
- Date: Fri, 16 Sep 2022 01:46:19 +0000 (UTC)
commit 0354dc295003e110610ae62e5faceb96775aea84
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Sep 15 19:22:39 2022 -0500
clippy: unsigned_abs() before casting to unsigned
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/747>
src/surface_utils/mod.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/surface_utils/mod.rs b/src/surface_utils/mod.rs
index fed60cbc1..bdec0f858 100644
--- a/src/surface_utils/mod.rs
+++ b/src/surface_utils/mod.rs
@@ -194,7 +194,7 @@ impl PixelOps for Pixel {
fn diff(&self, other: &Pixel) -> Pixel {
self.iter()
.zip(other.iter())
- .map(|(l, r)| (l as i32 - r as i32).abs() as u8)
+ .map(|(l, r)| (l as i32 - r as i32).unsigned_abs() as u8)
.collect()
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]