Question: I have an enum, `Angle`, which has two variants, `Degrees` and `Radians`. I wanted to implement `From` for these, but it doesn't let me:

```
enum Angle {
    Degrees(f64),
    Radians(f64)
}

impl From<Angle> for Angle {
    fn from(value: Angle) -> Self {
        match value {
            Angle::Degrees(deg) => Angle::Radians(deg / 180.0 * PI),
            Angle::Radians(rad) => Angle::Degrees(rad / PI * 180.0)
        }
    }
}

```

which throws

```
error[E0119]: conflicting implementations of trait `std::convert::From<Angle>` for type `Angle`
  --> src\lib.rs:45:1
   |
45 | impl From<Angle> for Angle {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: conflicting implementation in crate `core`:
           - impl<T> From<T> for T;

Some errors have detailed explanations: E0119, E0412, E0425.
For more information about an error, try `rustc --explain E0119`.

```

From what I can see there are three options for this:

1. I clarify this to the compiler in some way
2. I add two separate functions `to_degrees` and `to_radians`
3. I separate `Angle::Degrees` and `Angle::Radians` into two separate structs

If 1 is not possible, which is preferred of 2 and 3?

Answer: 
> 
> I wanted to implement `From` for these
> 
> 
> 

By that code, it appears that you want `From::from` to turn a value in degrees to a value in radians and vice versa. However, this is not only:

* **impossible**, because any `From<T>` is already implemented by the core library for `T`;
* but also **unintuitive**, because this is far from what a `From` conversion should be doing.

As such, trying to get the compiler to accept this is out of the question. The two alternatives provided are actually good, and are not mutually exclusive.

Whether to define independent structs for angles in degrees and angles in radians is case dependent. For what it's worth, the Rust API guidelines show how the [newtype pattern](https://rust-lang.github.io/api-guidelines/type-safety.html#c-newtype) can be used to prevent serious bugs by preventing you from mixing different measures. On the other hand, this type already does that.
#1 is indeed not possible. Rust has a blanket implementation `impl<T> From<T> for T` and you cannot overwrite it. Besides semantically what you are trying to do is not a `From` conversion, but rather changing a representation of some type.

I would strongly recommend #2. It is very idiomatic and anyone can tell after a glance what this methods would do (in contrast to what you written in your example).

You *could* do #3 but it's up to you how you want to design your code. If you already started with an enum it's probably the better fit for your problem, so I would recommend sticking to it. But if you decide that having two different structs is better for you, then #3 is still fine.