Simplify match → if let

This commit is contained in:
David Lukes 2018-02-26 12:23:15 +01:00
parent ad76741bca
commit ead81205cc

View File

@ -402,14 +402,11 @@ macro_rules! create_config {
}
};
let mut license_template_str = String::new();
match license_template_file.read_to_string(&mut license_template_str) {
Ok(_) => (),
Err(e) => {
eprintln!("Warning: unable to read from license template file {:?}: {}",
license_template_path, e);
return;
}
}
if let Err(e) = license_template_file.read_to_string(&mut license_template_str) {
eprintln!("Warning: unable to read from license template file {:?}: {}",
license_template_path, e);
return;
};
let license_template_parsed = match parse_license_template(&license_template_str) {
Ok(string) => string,
Err(e) => {