Simplify 'using_controller' example

This commit is contained in:
sharkdp authored and David Peter committed 2019-10-30 19:47:51 +01:00
1 parent 310654d49f
commit b9ce3c248c
4 files changed
+45 -38

No files matched your search

+4
View File
@@ -76,6 +76,10 @@ impl FromStr for OutputComponent {
pub struct OutputComponents(pub HashSet<OutputComponent>);
impl OutputComponents {
pub fn new(components: &[OutputComponent]) -> OutputComponents {
OutputComponents(components.iter().cloned().collect())
}
pub fn changes(&self) -> bool {
self.0.contains(&OutputComponent::Changes)
}