Skip to content

Commit

Permalink
implement ops::Not for AsciiSet
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka committed Sep 19, 2024
1 parent 360b17e commit 75ef8f9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions percent_encoding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ impl ops::Add for AsciiSet {
}
}

impl ops::Not for AsciiSet {
type Output = Self;

fn not(self) -> Self {
let mask = self.mask.map(|chunk| !chunk);
AsciiSet { mask }
}
}

/// The set of 0x00 to 0x1F (C0 controls), and 0x7F (DEL).
///
/// Note that this includes the newline and tab characters, but not the space 0x20.
Expand Down

0 comments on commit 75ef8f9

Please sign in to comment.