Simplify match → if let
This commit is contained in:
parent
ad76741bca
commit
ead81205cc
@ -402,14 +402,11 @@ fn set_license_template(&mut self) {
|
||||
}
|
||||
};
|
||||
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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user