I'm using the newtype in my collections wrapper. Like you can see in the following playground: Rust Playground.
The issue arise here:
...
fn get<K, Q>(&self, key: &K) -> Option<&ItemName>
where
K: Borrow<Q>,
Q: Into<ItemName>
{
self.items.get(key.into())
}
...
From what I understand, my type is missing some conversion methods but I don't see how to solve the issue...
error[E0277]: the trait bound `&ItemName: From<&K>` is not satisfied
--> src/lib.rs:30:28
|
30 | self.items.get(key.into())
| ^^^^ the trait `From<&K>` is not implemented for `&ItemName`
|
= note: required because of the requirements on the impl of `Into<&ItemName>` for `&K`