3 ms·
You don't need macros for generic code either :), Rust has generics. fn sqr<T: Copy + Mul>(x: T) -> T::Output { x * x }
by GlitchMr 7y ago
You don't need macros for generic code either :), Rust has generics.
fn sqr<T: Copy + Mul>(x: T) -> T::Output {
x * x
}