Helper methods on CatpureFilter for matching

Could be prettier, but want some way to check this in multiple places.
This commit is contained in:
Ian Douglas Scott 2025-06-04 09:35:08 -07:00 committed by Ian Douglas Scott
parent 6fd237ac39
commit a863e8f7d6
2 changed files with 19 additions and 8 deletions

View file

@ -182,11 +182,7 @@ impl AppData {
.toplevels()
.find(|info| info.foreign_toplevel == *toplevel);
if let Some(info) = info {
info.workspace.iter().any(|workspace| {
self.capture_filter
.toplevels_on_workspaces
.contains(workspace)
})
self.capture_filter.toplevel_matches(info)
} else {
false
}
@ -197,9 +193,7 @@ impl AppData {
.find(|g| g.workspaces.iter().any(|w| w == workspace))
.is_some_and(|group| {
self.capture_filter
.workspaces_on_outputs
.iter()
.any(|o| group.outputs.contains(o))
.workspace_outputs_matches(&group.outputs)
}),
CaptureSource::Output(_) => false,
}