1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 03:12:25 +01:00

Simplify 'using_controller' example

This commit is contained in:
sharkdp
2019-10-20 21:53:34 +02:00
committed by David Peter
parent 310654d49f
commit b9ce3c248c
4 changed files with 45 additions and 38 deletions

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)
}