master
Andrew Johnson 6 years ago
parent 43040a6094
commit 76071c66d4

@ -28,11 +28,17 @@ fn foo_u32(x: u32) -> u32
{
x*x
}
fn foo_f32(x: f32) -> f32
{
x*x
}
fn foo_i32(x: i32) -> i32
{
x*x
}
//can be written with generics
fn foo<T>(x: T) -> T
where T: std::ops::Mul<Output = T> + Copy

Loading…
Cancel
Save