Closed sempervictus closed 3 years ago
Interesting, cargo test
does not like the From and TryFrom - conflicts with Core, supposedly:
$ cargo test
Compiling rust-hl7 v0.3.0 (/opt/code/Rust/rust-hl7)
error[E0119]: conflicting implementations of trait `std::convert::TryFrom<&str>` for type `message::Message<'_>`
--> src/message.rs:113:1
|
113 | impl<'a> TryFrom<&'a str> for Message<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T, U> TryFrom<U> for T
where U: Into<T>;
error[E0119]: conflicting implementations of trait `std::convert::TryFrom<&str>` for type `message::Message<'_>`
--> src/message.rs:113:1
|
113 | impl<'a> TryFrom<&'a str> for Message<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T, U> std::convert::TryFrom<U> for T
where U: Into<T>;
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.
error: could not compile `rust-hl7`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.
error: build failed
which seems to be this issue - looking into "specialization" (always fun to learn something new :) ).
Confusing. The more specificity i add the more confusing the compiler errors get.
I guess we either have to choose from()
or try_from()
- thoughts?
Merges the parallel work we both started doing into a single implementation providing both by wrapping
from
withtry_from
to deliver raw and wrapped results.