ent list: add filtering based on tags

This commit is contained in:
Sebastian Kuzminsky 2025-07-12 14:24:40 -06:00
parent 28db7669f4
commit 9d4409c008
3 changed files with 50 additions and 0 deletions

View file

@ -347,6 +347,20 @@ impl Issue {
))?;
Ok(())
}
pub fn has_tag(&self, tag: &str) -> bool {
let tag_string = String::from(tag);
self.tags.iter().position(|x| x == &tag_string).is_some()
}
pub fn has_any_tag(&self, tags: &std::collections::HashSet<&str>) -> bool {
for tag in tags.iter() {
if self.has_tag(tag) {
return true;
}
}
return false;
}
}
// This is the internal/private API of Issue.