[librsvg: 11/16] clippy: unsigned_abs() before casting to unsigned




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]