Kero
January 8, 2017, 4:52pm
1
The real issue is here: https://github.com/Kerollmops/ripin-rs/issues/9
I am trying to make a method that can get a generic type Index<I>
or Index<&I>
in parameter, is it possible or not ?
With the help of the AsRef
and the Into
traits maybe ?
bluss
January 8, 2017, 6:30pm
2
Borrow<T>
is implemented for both T
and &T
, so using that is a possibility. (This is unlike AsRef<T>
, which is not implemented for T
).
Kero
January 8, 2017, 6:34pm
3
Ho ! You're a gentleman ! Thank you, I will look at this right now.
Kero
January 8, 2017, 8:59pm
4
Hum it seems to be a Trait not adapted for this situation.
I will make a specific Trait to handle my problem (Index<I>
and Index<&I>
).
Eh2406
January 9, 2017, 2:44am
5
for <T: Borrow<I>, I, W: Index<T>> ...
or something like that?
1 Like