From 6cffd2f452a1fa8a32aa6ac1651be63b49459869 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 11 Dec 2024 14:37:17 -0500 Subject: [PATCH] fix: use total_cmp where possible --- core/src/gradient.rs | 2 +- graphics/src/gradient.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/gradient.rs b/core/src/gradient.rs index ccae0bce..722c3c5c 100644 --- a/core/src/gradient.rs +++ b/core/src/gradient.rs @@ -70,7 +70,7 @@ impl Linear { let (Ok(index) | Err(index)) = self.stops.binary_search_by(|stop| match stop { None => Ordering::Greater, - Some(stop) => stop.offset.partial_cmp(&offset).unwrap(), + Some(stop) => stop.offset.total_cmp(&offset), }); if index < 8 { diff --git a/graphics/src/gradient.rs b/graphics/src/gradient.rs index 54261721..95593c59 100644 --- a/graphics/src/gradient.rs +++ b/graphics/src/gradient.rs @@ -67,7 +67,7 @@ impl Linear { let (Ok(index) | Err(index)) = self.stops.binary_search_by(|stop| match stop { None => Ordering::Greater, - Some(stop) => stop.offset.partial_cmp(&offset).unwrap(), + Some(stop) => stop.offset.total_cmp(&offset), }); if index < 8 {