From a333b4ccea89eb644ce8c44a3c7e88ed2a3bcee2 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Mon, 16 Dec 2019 12:13:46 +0100 Subject: [PATCH] pxar: match_pattern: impl invert() to switch the match type of a MatchPattern. Signed-off-by: Christian Ebner --- src/pxar/match_pattern.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pxar/match_pattern.rs b/src/pxar/match_pattern.rs index c5af8f28..d4424264 100644 --- a/src/pxar/match_pattern.rs +++ b/src/pxar/match_pattern.rs @@ -202,6 +202,11 @@ impl MatchPattern { MatchPatternSlice::to_bytes(&slices) } + + /// Invert the match type for this MatchPattern. + pub fn invert(&mut self) { + self.match_positive = !self.match_positive; + } } #[derive(Clone)]