Changes the From impl to use the Versioned type rather than the associated type (through obake::AnyVersion). This shouldn't change anything functionally but fixes an issue we were seeing where the obake impl From<foo::Foo_v0_1_0> for <foo::Foo_v0_1_0 as obake::Versioned>::Versioned impl was conflicting with other generic impls.
error[E0119]: conflicting implementations of trait `std::convert::From<foo::Foo_v0_1_0>` for type `Batz`
--> bar\src\lib.rs:7:1
|
7 | / impl<T> From<T> for Batz
8 | | where
9 | | T: Into<Cow<'static, str>>,
10 | | {
... |
13 | | }
14 | | }
| |_^
|
= note: conflicting implementation in crate `foo`:
- impl From<foo::Foo_v0_1_0> for <foo::Foo_v0_1_0 as obake::Versioned>::Versioned;
I believe this occurs because
impl From<foo::Foo_v0_1_0> for <foo::Foo_v0_1_0 as obake::Versioned>::Versioned can technically be the same as impl<T> From<T> for Batz if <foo::Foo_v0_1_0 as obake::Versioned>::Versioned implemented Into<Cow<'static, str>>. Using the actual type, rather than the associated type, helps avoid this problem.
Changes the
From
impl to use theVersioned
type rather than the associated type (throughobake::AnyVersion
). This shouldn't change anything functionally but fixes an issue we were seeing where the obakeimpl From<foo::Foo_v0_1_0> for <foo::Foo_v0_1_0 as obake::Versioned>::Versioned
impl was conflicting with other generic impls.You can see a small reproducible example of this issue here: https://github.com/goodSyntax808/obake-example-issue which gives the following error when trying to compile:
I believe this occurs because
impl From<foo::Foo_v0_1_0> for <foo::Foo_v0_1_0 as obake::Versioned>::Versioned
can technically be the same asimpl<T> From<T> for Batz
if<foo::Foo_v0_1_0 as obake::Versioned>::Versioned
implementedInto<Cow<'static, str>>
. Using the actual type, rather than the associated type, helps avoid this problem.