diff --git a/server/bleep/src/query/execute.rs b/server/bleep/src/query/execute.rs index d9de182d29..009a16d9d2 100644 --- a/server/bleep/src/query/execute.rs +++ b/server/bleep/src/query/execute.rs @@ -415,7 +415,7 @@ impl ExecuteQuery for FileReader { .filter(|q| self.query_matches(q)) .filter_map(|q| { let regex_str = q.path.as_ref()?.regex_str(); - let case_insensitive = !q.case_sensitive.unwrap_or(true); + let case_insensitive = !q.is_case_sensitive(); let regex = RegexBuilder::new(®ex_str) .case_insensitive(case_insensitive) .build() @@ -503,7 +503,7 @@ impl ExecuteQuery for RepoReader { .filter(|q| self.query_matches(q)) .filter_map(|q| { let regex_str = q.path.as_ref()?.regex_str(); - let case_insensitive = !q.case_sensitive.unwrap_or(true); + let case_insensitive = !q.is_case_sensitive(); let regex = RegexBuilder::new(®ex_str) .case_insensitive(case_insensitive) .build() diff --git a/server/bleep/src/query/parser.rs b/server/bleep/src/query/parser.rs index edbac43fba..782c616b4d 100644 --- a/server/bleep/src/query/parser.rs +++ b/server/bleep/src/query/parser.rs @@ -137,7 +137,8 @@ impl<'a> Query<'a> { } pub fn is_case_sensitive(&self) -> bool { - self.case_sensitive.unwrap_or(true) + // defaults to false if unset + self.case_sensitive.unwrap_or_default() } fn set_global_regex(&mut self, value: Option) {