Especially because the fix is so easy, it could just be fixed by the compiler on the fly.
If you have a function
fn a(arg: Into<C>) { expensive/extensive operations here }
a(&"test"); a(10);
fn a_str(arg: &str) { /// expensive/extensive operations } fn a_u16(arg: u16) { /// expensive/extensive operations }
fn expensive_ops(arg: C) { // ... } fn a_str(arg: &str) { let _arg: C = arg.into(); expensive_ops(_arg); }
Especially because the fix is so easy, it could just be fixed by the compiler on the fly.
If you have a function
and call it two times The compiler will generate two functions This can be fixed by just proxying the duplicated call like this