Say
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum A {
Int8,
pub enum B {
Int8,
I have
impl From<A> for B {
fn from(item: A) -> Self {
match item {
A::Int8 => B::Int8,
}
}
}
When users have let a: &A
, they need to write let b: B = (*a).into();
is there a way to avoid the (*a)
and allow both &A
and A
to be converted?