2 ms·
It would be more elegant to move the "inner" function to the top level, and expose a separate helper function that does conversion. The current Rust code seems
by zozbot234 4y ago
It would be more elegant to move the "inner" function to the top level, and expose a separate helper function that does conversion. The current Rust code seems to be constrained by backward compatibility, where the code was written with a generic interface to start with and this had to be preserved.
- JoshTriplett 4y agoI think it'd be most elegant if we avoid the inner/outer structure, write the function generically without calling an inner function, and then teach the compiler to automatically factor out the non-generic part of the function as an optimization.