From 92f38d1b70e6af8a70a0d4d90b35c559f377f7da Mon Sep 17 00:00:00 2001 From: Philip Daniels Date: Sun, 25 Feb 2018 21:28:04 +0000 Subject: [PATCH] Remove unnecessary if when compiling the glob set. --- components/config/src/lib.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/components/config/src/lib.rs b/components/config/src/lib.rs index b9870e5..9f86c52 100644 --- a/components/config/src/lib.rs +++ b/components/config/src/lib.rs @@ -115,14 +115,12 @@ impl Config { let mut glob_set_builder = GlobSetBuilder::new(); if let Some(ref v) = config.ignored_content { - if v.len() > 0 { - for pat in v { - let glob = match Glob::new(pat) { - Ok(g) => g, - Err(e) => bail!("Invalid ignored_content glob pattern: {}, error = {}", pat, e) - }; - glob_set_builder.add(glob); - } + for pat in v { + let glob = match Glob::new(pat) { + Ok(g) => g, + Err(e) => bail!("Invalid ignored_content glob pattern: {}, error = {}", pat, e) + }; + glob_set_builder.add(glob); } } config.ignored_content_globber = Some(glob_set_builder.build().expect("Bad ignored_content in config file."));