Created
January 16, 2019 15:38
-
-
Save leopard627/578a30dd50d748ce377e8c8ac8d0dd6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn method_test() { | |
let apple_ii = Computer{ | |
serial: String::from("APPLEISBEST!!"), | |
model: String::from("APPLE II"), | |
cpu: 32, | |
ram: 1024 * 100, | |
}; | |
let mac = Computer{ | |
serial: String::from("MACISBEST!!!"), | |
model: String::from("MAC"), | |
cpu: 64, | |
ram: 2048 * 100, | |
}; | |
println!("{:?}", mac.about_serial()); | |
println!("{:?}", mac.about_ram()); | |
println!("Mac CPU is better? {:?}", mac.has_better_cpu_than(&apple_ii)); | |
println!("Mac RAM is better? {:?}", mac.has_better_ram_than(&apple_ii)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment