I want to do something like the following
use std::ops::Deref;
struct Struct;
impl<T: Deref<Target=str>> From<T> for Struct { ... }
impl<T: Deref<Target=[u8]>> From<T> for Struct { ... }
Which causes a conflicting implementations error. From my understanding it should be impossible to have conflicting implementations since you can't implement Deref
with two different Target
types for any T
so there will never be ambiguity. Am I missing something?
1 post - 1 participant