From d31a8181bd4ac80ef678c29e6fab5607628bb76e Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 17 Jul 2026 00:11:59 +0800 Subject: feat(flag): implement Not operator for Flag --- mingling_picker/src/value.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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, + } + } +} -- cgit