Admittedly, I'm pretty new to Rust, but I like what I see so far. However, I encountered a problem when I receive an error message:
error: only the builtin traits can be used as closure or object bounds [E0225]
defaults: HashMap<String, Box<Any + From<String> + PartialOrd>>,
^~~~~~~~~~~~
for the following code:
pub struct Builder {
defaults: HashMap<String, Box<Any + From<String> + PartialOrd>>,
...
}
If I delete the link to From, I get the same error, but for PartialOrd. I do not understand why, because I'm sure that both Fromand PartialOrdare built in features. Any help would be greatly appreciated.
source
share