JelteF/derive_more

Support `TryIntoRef`

siefkenj opened this issue · 2 comments

I am wondering if this project would be open to adding implementations of TryFrom<&T> for &Inner traits. It might look like,

#[derive(derive_more::TryIntoRef)]
enum Foo {
   X(String),
   Y(String)
}

fn main() {
   let foo = Foo::X("hi".to_string());
   let x: &String = foo.try_into().unwrap();
}

If so, I should be able to make a PR.

With 1.0.0-beta.6 this is already supported afaik: https://docs.rs/derive_more/1.0.0-beta.6/derive_more/derive.TryInto.html

That's great news. Thanks!