Remove unnecessary heap allocations in PrettyPrinter::print for style components

This commit is contained in:
rhysd committed 2023-01-15 21:16:36 +09:00
1 parent 5e3abcad07
commit 4cc2a489d0
2 files changed
+21 -12

No files matched your search

+8
View File
@@ -129,4 +129,12 @@ impl StyleComponents {
pub fn plain(&self) -> bool {
self.0.iter().all(|c| c == &StyleComponent::Plain)
}
pub fn insert(&mut self, component: StyleComponent) {
self.0.insert(component);
}
pub fn clear(&mut self) {
self.0.clear();
}
}