rameteryou might be missing a type parameter or trait boundexpected type parameterfound type parametera type parameter was expected, but a different one was found; you might be missing a type parameter or trait boundfor more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameterstype parameters must be constrained to match other typesgiven a type parameter `T` and a method `foo`: ``` trait Trait { fn foo(&self) -> T; } ``` the only ways to implement method `foo` are: - constrain `T` with an explicit type: ``` impl Trait for X { fn foo(&self) -> String { String::new() } } ``` - add a trait bound to `T` and call a method on that trait that returns `Self`: ``` impl Trait for X { fn foo(&self) -> T { ::default() } } ``` - change `foo` to return an argument of type `T`: ``` impl Trait for X { fn foo(&self, x: T) -> T { x } } ```expected this type parameterevery closure has a distinct type and so could not always match the caller-chosen type of parameter `you can box the `` to coerce it to `Box<>`, but you'll have to change the expected type as well` so you could box the found value and coerce it to the trait object `Box`, you will have to change the expected type as well