Make from_get_set public (#34)

This allows the slider value to be obtained from anywhere that can be accessed from a closure and not just a `&'a mut` reference. An example would be a state that is shared via an Arc<Rw<T>> or Atomic value with a background thread
This commit is contained in:
Hizoul 2020-10-28 16:56:33 +01:00 committed by GitHub
parent 07a32793d6
commit fe585e48e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ pub struct Slider<'a> {
} }
impl<'a> Slider<'a> { impl<'a> Slider<'a> {
fn from_get_set( pub fn from_get_set(
range: RangeInclusive<f64>, range: RangeInclusive<f64>,
get_set_value: impl 'a + FnMut(Option<f64>) -> f64, get_set_value: impl 'a + FnMut(Option<f64>) -> f64,
) -> Self { ) -> Self {