chore(rust): make Query extra predicates state fully immutable

This commit is contained in:
Andrew Hlynskyi 2023-09-01 05:33:52 +03:00
parent 74e77b10c1
commit 52f7eaff31
6 changed files with 96 additions and 78 deletions

View file

@ -828,8 +828,8 @@ impl<'a> LanguageConfiguration<'a> {
let mut all_highlight_names = self.highlight_names.lock().unwrap();
if self.use_all_highlight_names {
for capture_name in result.query.capture_names() {
if !all_highlight_names.contains(capture_name) {
all_highlight_names.push(capture_name.clone());
if !all_highlight_names.iter().any(|x| x == capture_name) {
all_highlight_names.push(capture_name.to_string());
}
}
}