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:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user