Skip to content

Commit

Permalink
Remove deprecated implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dylni committed Nov 27, 2021
1 parent bc3341a commit 94bd618
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ getrandom = "0.2"
[features]
default = ["memchr", "raw_os_str"]

deprecated-byte-patterns = []
raw_os_str = []
7 changes: 0 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@
//!
//! ### Optional Features
//!
//! - **deprecated-byte-patterns** -
//! Provides an implementation of [`Pattern`] for [`u8`] that panics when it
//! is not an ASCII character. *This feature is deprecated and was only added
//! to ease removal of this pattern type.*
//!
//! - **print\_bytes** -
//! Provides implementations of [`print_bytes::ToBytes`] for [`RawOsStr`] and
//! [`RawOsString`].
Expand Down Expand Up @@ -433,6 +428,4 @@ mod private {
impl Sealed for PathBuf {}
impl Sealed for &str {}
impl Sealed for &String {}
#[cfg(feature = "deprecated-byte-patterns")]
impl Sealed for u8 {}
}
29 changes: 0 additions & 29 deletions src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ pub trait Encoded {
fn __get(&self) -> &[u8];
}

#[cfg(feature = "deprecated-byte-patterns")]
#[derive(Clone)]
pub struct EncodedByte([u8; 1]);

#[cfg(feature = "deprecated-byte-patterns")]
impl Encoded for EncodedByte {
#[inline]
fn __get(&self) -> &[u8] {
&self.0
}
}

#[derive(Clone)]
pub struct EncodedChar {
buffer: [u8; 4],
Expand Down Expand Up @@ -87,20 +75,3 @@ impl<'a> Pattern for &'a String {
(**self).__encode()
}
}

#[cfg(feature = "deprecated-byte-patterns")]
#[cfg_attr(
os_str_bytes_docs_rs,
doc(cfg(feature = "deprecated-byte-patterns"))
)]
impl Pattern for u8 {
#[doc(hidden)]
type __Encoded = EncodedByte;

#[doc(hidden)]
fn __encode(self) -> Self::__Encoded {
assert!(self.is_ascii(), "byte pattern is not ASCII");

EncodedByte([self])
}
}

0 comments on commit 94bd618

Please sign in to comment.