22 lines
464 B
Rust
22 lines
464 B
Rust
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();
|
|
}
|