aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mingling_picker/src/value.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/mingling_picker/src/value.rs b/mingling_picker/src/value.rs
index 7d52442..ee0d6ee 100644
--- a/mingling_picker/src/value.rs
+++ b/mingling_picker/src/value.rs
@@ -1,6 +1,6 @@
use std::{
fmt::{Debug, Display},
- ops::Deref,
+ ops::{Deref, Not},
};
/// Parsed result of a boolean-style command-line flag.
@@ -132,3 +132,14 @@ impl Deref for Flag {
}
}
}
+
+impl Not for Flag {
+ type Output = Flag;
+
+ fn not(self) -> Flag {
+ match self {
+ Flag::Active => Flag::Inactive,
+ Flag::Inactive => Flag::Active,
+ }
+ }
+}