Skip to content

Commit 75ef8f9

Browse files
committed
implement ops::Not for AsciiSet
1 parent 360b17e commit 75ef8f9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

percent_encoding/src/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ impl ops::Add for AsciiSet {
120120
}
121121
}
122122

123+
impl ops::Not for AsciiSet {
124+
type Output = Self;
125+
126+
fn not(self) -> Self {
127+
let mask = self.mask.map(|chunk| !chunk);
128+
AsciiSet { mask }
129+
}
130+
}
131+
123132
/// The set of 0x00 to 0x1F (C0 controls), and 0x7F (DEL).
124133
///
125134
/// Note that this includes the newline and tab characters, but not the space 0x20.

0 commit comments

Comments
 (0)