Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
lib: Fix clippy warnings
Erik Kundt committed 1 year ago
commit bc2378e18a148923839c352a34b10e0847c22c5c
parent e09394d8a05a2dcbbc76efdbb97ab92487fb2873
1 file changed +1 -1
modified src/ui/widget/utils.rs
@@ -20,7 +20,7 @@ pub mod scroll {
        let t = len.saturating_sub(1) as f64;
        let v = y / (t - h) * 100_f64;

-
        std::cmp::max(0, std::cmp::min(100, v as usize))
+
        (v as usize).clamp(0, 100)
    }

    fn map_range(from: (f64, f64), to: (f64, f64), value: f64) -> f64 {