2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -0,0 +1,9 @@
// Defines a generic struct where x and y can be of any type T
struct Point<T> {
x: T,
y: T,
}
fn main() {
let p = Point { x: 1.0, y: 2.5 }; // p is of type Point<f64>
println!("{}, {}", p.x, p.y);
}

View file

@ -0,0 +1,5 @@
struct Point<T>(T, T);
fn main() {
let p = Point(1.0, 2.5);
println!("{},{}", p.0, p.1);
}

View file

@ -0,0 +1,4 @@
fn main() {
let p = (0.0, 2.4);
println!("{},{}", p.0, p.1);
}