INNER CODE UNIT · Rust
insert
bgreenwell/doxx · src/widgets/mod.rs:31
pub fn insert(&mut self, element_index: usize, width: u16, lines: Vec<Line<'static>>) {
self.cache.insert((element_index, width), lines);
}
/// Invalidate cache if terminal width changed
pub fn check_width(&mut self, width: u16) {
if width != self.last_width {
self.cache.clear();
self.last_width = width;
}
}
}