macro_rules! impl_as_ref { ($ty:ty, $inner:ty) => { ... }; }
Implement AsRef for a newtype struct.
AsRef
The first argument is that of the newtype struct to create the impl for and the second is the wrapped type.
use impl_more::impl_as_ref; struct Foo(String); impl_as_ref!(Foo, String); let foo = Foo("bar".to_owned()); assert_eq!(foo.as_ref(), "bar");