From e8d96525f4530c5426c8d2088ff99a18460e88b7 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 24 Jun 2026 21:03:17 +0200 Subject: [PATCH] Make `Slider::new` take `impl Into coords.as_mut()[i].1 = value, None => coords.push(axis.tag, value), diff --git a/crates/egui/src/widgets/slider.rs b/crates/egui/src/widgets/slider.rs index 50b0265f1..b5ce4fc55 100644 --- a/crates/egui/src/widgets/slider.rs +++ b/crates/egui/src/widgets/slider.rs @@ -125,7 +125,11 @@ impl<'a> Slider<'a> { /// /// The `value` given will be clamped to the `range`, /// unless you change this behavior with [`Self::clamping`]. - pub fn new(value: &'a mut Num, range: RangeInclusive) -> Self { + pub fn new( + value: &'a mut Num, + range: impl Into>, + ) -> Self { + let range = range.into(); let range_f64 = range.start().to_f64()..=range.end().to_f64(); let slf = Self::from_get_set(range_f64, move |v: Option| { if let Some(v) = v {