self.objects.is_empty()
}
- // TODO this is linear, and it probably is possible to improve this
pub fn get_by_name(&self, name: &str) -> Option<&SwaybarObject> {
if let Some(idx) = self.objects_idx_map.get(name) {
return Some(&self.objects[*idx]);
None
}
- // TODO this is linear, and it probably is possible to improve this
pub fn get_by_name_mut(&mut self, name: &str) -> Option<&mut SwaybarObject> {
if let Some(idx) = self.objects_idx_map.get(name) {
return Some(&mut self.objects[*idx]);