diff --git a/percent_encoding/Cargo.toml b/percent_encoding/Cargo.toml index a737e333c..e5ff212b1 100644 --- a/percent_encoding/Cargo.toml +++ b/percent_encoding/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "percent-encoding" -version = "2.0.0" +version = "2.1.0" authors = ["The rust-url developers"] description = "Percent encoding and decoding" repository = "https://github.com/servo/rust-url/" diff --git a/percent_encoding/lib.rs b/percent_encoding/lib.rs index 170674aa8..27eaf6740 100644 --- a/percent_encoding/lib.rs +++ b/percent_encoding/lib.rs @@ -83,6 +83,12 @@ impl AsciiSet { mask[byte as usize / BITS_PER_CHUNK] |= 1 << (byte as usize % BITS_PER_CHUNK); AsciiSet { mask } } + + pub const fn remove(&self, byte: u8) -> Self { + let mut mask = self.mask; + mask[byte as usize / BITS_PER_CHUNK] &= !(1 << (byte as usize % BITS_PER_CHUNK)); + AsciiSet { mask } + } } /// The set of 0x00 to 0x1F (C0 controls), and 0x7F (DEL).