I tried to implement another trait (Sanitize) for all FunctorMut's where the item implements Sanitize. But when I try to do this:
use fmap::FunctorMut;/// The Sanitize trait generalises types that are to be sanitized.pubtraitSanitize{/// Call this associated method when sanitizing.fnsanitize(&mutself);}/// A blanket impl that allows sanitizing values inside of common data structures like [Option] and [Vec].////// ## Example////// ```/// use sanitizer::Sanitize;////// #[derive(Debug, PartialEq)]/// struct MyValue(i32);////// impl Sanitize for MyValue {/// /// If the inner value is `0`, change it to `1`./// fn sanitize(&mut self) {/// if self.0 == 0 {/// self.0 = 1;/// }/// }/// }////// let mut wrapped_value = Some(MyValue(0));/// wrapped_value.sanitize();/// assert_eq!(wrapped_value, Some(MyValue(1)));/// ```impl<'a,A,T>SanitizeforTwhereA:'a,T:FunctorMut<'a,A>,T::Inner:Sanitize,{fnsanitize(&mutself){self.fmap_mut(Sanitize::sanitize)}}I get this error:
error[E0207]: the type parameter `A` is not constrained by the impl trait, self type, or predicates
and I don't know how to proceed.
You can find context and details here.
I tried to implement another trait (
Sanitize) for allFunctorMut's where the item implementsSanitize. But when I try to do this:I get this error:
and I don't know how to proceed.
You can find context and details here.