complete lesson

This commit is contained in:
2020-03-28 19:49:57 +01:00
parent 86ffdd7397
commit cbfbdab6c4
7 changed files with 117 additions and 7 deletions

View File

@ -2,16 +2,20 @@ mod car;
use car::Information;
fn main() {
// create a new car and store it in the variable 'a'
let a = car::Car {
// set some data for that car
manufacturer: "Benz".to_string(),
model: "Velo".to_string()
};
// do the same for a second car
let b = car::Car {
manufacturer: "Ford".to_string(),
model: "Model T".to_string()
};
// use a function of the car class to print out the information
a.print_info();
b.print_info();
}