diff options
-rw-r--r-- | src/pagespec.rs | 12 | ||||
-rw-r--r-- | src/site.rs | 6 |
2 files changed, 3 insertions, 15 deletions
diff --git a/src/pagespec.rs b/src/pagespec.rs index 1ebb1b1..55c83fb 100644 --- a/src/pagespec.rs +++ b/src/pagespec.rs @@ -93,11 +93,7 @@ pub enum OpCode { fn glob_matches(glob: &str, path: &str) -> bool { let glob: Vec<char> = glob.chars().collect(); let path: Vec<char> = path.chars().collect(); - if glob_matches_helper(&glob, &path) { - true - } else { - false - } + glob_matches_helper(&glob, &path) } fn glob_matches_helper(mut glob: &[char], mut path: &[char]) -> bool { @@ -141,11 +137,7 @@ fn glob_matches_helper(mut glob: &[char], mut path: &[char]) -> bool { fn page_matches(site: &Site, container: &Path, glob: &str, path: &str) -> bool { if glob_matches(glob, path) { let full_path = container.join(path); - if site.is_page(&full_path) { - true - } else { - false - } + site.is_page(&full_path) } else { false } diff --git a/src/site.rs b/src/site.rs index 10fa923..6fa4625 100644 --- a/src/site.rs +++ b/src/site.rs @@ -118,11 +118,7 @@ impl Site { } pub fn is_page(&self, path: &Path) -> bool { - if self.pages_that_will_exist.get(path).is_some() { - true - } else { - false - } + self.pages_that_will_exist.get(path).is_some() } fn all_files(&self) -> Result<Vec<Name>, SiteError> { |