Use pattern matching instead of manually checking condition

This commit is contained in:
Lzu Tao 2020-03-14 19:29:48 +07:00
parent ceb9b7d66d
commit 29df0139dc

View file

@ -68,13 +68,8 @@ fn integration_test() {
}
match output.status.code() {
Some(code) => {
if code == 0 {
println!("Compilation successful");
} else {
eprintln!("Compilation failed. Exit code: {}", code);
}
},
Some(0) => println!("Compilation successful"),
Some(code) => eprintln!("Compilation failed. Exit code: {}", code),
None => panic!("Process terminated by signal"),
}
}