diff options
Diffstat (limited to 'vendor/gix-attributes/src/state.rs')
-rw-r--r-- | vendor/gix-attributes/src/state.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/gix-attributes/src/state.rs b/vendor/gix-attributes/src/state.rs index 27ce2a247..ffc0bce41 100644 --- a/vendor/gix-attributes/src/state.rs +++ b/vendor/gix-attributes/src/state.rs @@ -69,6 +69,16 @@ impl StateRef<'_> { pub fn is_unspecified(&self) -> bool { matches!(self, StateRef::Unspecified) } + + /// Return `true` if the associated attribute was set with `attr`. Note that this will also be `true` if a value is assigned. + pub fn is_set(&self) -> bool { + matches!(self, StateRef::Set | StateRef::Value(_)) + } + + /// Return `true` if the associated attribute was set with `-attr` to specifically remove it. + pub fn is_unset(&self) -> bool { + matches!(self, StateRef::Unset) + } } /// Initialization |