From c286958c6386d66190dcca405e82684cac9b66c3 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 30 Jan 2022 13:15:42 +0100 Subject: [PATCH] Swap around trait bound order --- src/formatters.rs | 2 +- src/params.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/formatters.rs b/src/formatters.rs index a7a14bb9..8e3265e6 100644 --- a/src/formatters.rs +++ b/src/formatters.rs @@ -17,6 +17,6 @@ //! Convenience functions for formatting and parsing parameter values in common formats. /// Round an `f32` value to always have a specific number of decimal digits. -pub fn f32_rounded(digits: usize) -> Option String>> { +pub fn f32_rounded(digits: usize) -> Option String + Send + Sync>> { Some(Box::new(move |x| format!("{:.digits$}", x))) } diff --git a/src/params.rs b/src/params.rs index 855a5af2..bd14bd10 100644 --- a/src/params.rs +++ b/src/params.rs @@ -55,11 +55,11 @@ pub struct PlainParam { /// The parameter value's unit, added after `value_to_string` if that is set. pub unit: &'static str, /// Optional custom conversion function from a plain **unnormalized** value to a string. - pub value_to_string: Option String>>, + pub value_to_string: Option String + Send + Sync>>, /// Optional custom conversion function from a string to a plain **unnormalized** value. If the /// string cannot be parsed, then this should return a `None`. If this happens while the /// parameter is being updated then the update will be canceled. - pub string_to_value: Option Option>>, + pub string_to_value: Option Option + Send + Sync>>, } /// A simple boolean parmaeter. @@ -70,11 +70,11 @@ pub struct BoolParam { /// The parameter's human readable display name. pub name: &'static str, /// Optional custom conversion function from a boolean value to a string. - pub value_to_string: Option String>>, + pub value_to_string: Option String + Send + Sync>>, /// Optional custom conversion function from a string to a boolean value. If the string cannot /// be parsed, then this should return a `None`. If this happens while the parameter is being /// updated then the update will be canceled. - pub string_to_value: Option Option>>, + pub string_to_value: Option Option + Send + Sync>>, } /// Describes a single parmaetre of any type.