From 94bd6180db7003fae0369ca4eb4896987fcca591 Mon Sep 17 00:00:00 2001 From: dylni <46035563+dylni@users.noreply.github.com> Date: Sat, 27 Nov 2021 12:35:09 -0500 Subject: [PATCH] Remove deprecated implementation --- Cargo.toml | 1 - src/lib.rs | 7 ------- src/pattern.rs | 29 ----------------------------- 3 files changed, 37 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4b8f3fc..402b3dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,5 +30,4 @@ getrandom = "0.2" [features] default = ["memchr", "raw_os_str"] -deprecated-byte-patterns = [] raw_os_str = [] diff --git a/src/lib.rs b/src/lib.rs index 55bc113..89c5b10 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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`]. @@ -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 {} } diff --git a/src/pattern.rs b/src/pattern.rs index 4a87881..fbf0054 100644 --- a/src/pattern.rs +++ b/src/pattern.rs @@ -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], @@ -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]) - } -}