auto_ref
Attributes for replace reference parameter &T
to impl AsRef<T>
or impl Borrow<T>
```rs use autoref::{autoref, auto_borrow};
fn example1(s: &str, t: &mut str) { println!("{}, {}", s, t); }
fn example2(s: &str, t: &mut str) { println!("{}, {}", s, t); }
fn example3(s: &str, t: &str) { println!("{}, {}", s, t); } ```
The above code is convert to
```rs
fn example1(s: impl ::core::convert::AsRef
fn example2(s: impl ::core::borrow::Borrow
fn example3(s: impl ::core::convert::AsRef