Skip to content

Commit 0d33781

Browse files
committed
percent-encoding: Allow to remove character from AsciiSet
1 parent f491cb4 commit 0d33781

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

percent_encoding/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ impl AsciiSet {
8383
mask[byte as usize / BITS_PER_CHUNK] |= 1 << (byte as usize % BITS_PER_CHUNK);
8484
AsciiSet { mask }
8585
}
86+
87+
pub const fn remove(&self, byte: u8) -> Self {
88+
let mut mask = self.mask;
89+
mask[byte as usize / BITS_PER_CHUNK] &= !(1 << (byte as usize % BITS_PER_CHUNK));
90+
AsciiSet { mask }
91+
}
8692
}
8793

8894
/// The set of 0x00 to 0x1F (C0 controls), and 0x7F (DEL).

0 commit comments

Comments
 (0)