MCPcopy Create free account
hub / github.com/PerroEngine/Perro / toggle_open

Method toggle_open

perro_source/core/perro_ui/src/tree.rs:183–189  ·  view source on GitHub ↗
(&mut self, index: usize)

Source from the content-addressed store, hash-verified

181 }
182
183 pub fn toggle_open(&mut self, index: usize) -> bool {
184 let Some(item) = self.items.get_mut(index) else {
185 return false;
186 };
187 item.open = !item.open;
188 true
189 }
190
191 pub fn select(&mut self, index: Option<usize>) {
192 self.selected_index = index.filter(|index| *index < self.items.len());

Callers

nothing calls this directly

Calls 1

get_mutMethod · 0.45

Tested by

no test coverage detected