Remove unnecessary if when compiling the glob set.

This commit is contained in:
Philip Daniels 2018-02-25 21:28:04 +00:00
parent 045e9def21
commit 92f38d1b70

View file

@ -115,14 +115,12 @@ impl Config {
let mut glob_set_builder = GlobSetBuilder::new(); let mut glob_set_builder = GlobSetBuilder::new();
if let Some(ref v) = config.ignored_content { if let Some(ref v) = config.ignored_content {
if v.len() > 0 { for pat in v {
for pat in v { let glob = match Glob::new(pat) {
let glob = match Glob::new(pat) { Ok(g) => g,
Ok(g) => g, Err(e) => bail!("Invalid ignored_content glob pattern: {}, error = {}", pat, e)
Err(e) => bail!("Invalid ignored_content glob pattern: {}, error = {}", pat, e) };
}; glob_set_builder.add(glob);
glob_set_builder.add(glob);
}
} }
} }
config.ignored_content_globber = Some(glob_set_builder.build().expect("Bad ignored_content in config file.")); config.ignored_content_globber = Some(glob_set_builder.build().expect("Bad ignored_content in config file."));