Skip to content

Commit

Permalink
Use f64::clamp (#44)
Browse files Browse the repository at this point in the history
Stabilized in Rust 1.50, and resvg now has MSRV 1.65.

---------

Co-authored-by: Daniel McNab <[email protected]>
  • Loading branch information
tomcur and DJMcNab authored Jan 6, 2025
1 parent 8da2335 commit 5c115f9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,8 @@ fn bound<T: Ord>(min: T, val: T, max: T) -> T {

#[inline]
fn f64_bound(min: f64, val: f64, max: f64) -> f64 {
debug_assert!(min.is_finite());
debug_assert!(val.is_finite());
debug_assert!(max.is_finite());
val.max(min).min(max)
val.clamp(min, max)
}

#[rustfmt::skip]
Expand Down

0 comments on commit 5c115f9

Please sign in to comment.