File tree 3 files changed +14
-0
lines changed
3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -29,4 +29,5 @@ getrandom = "0.2"
29
29
[features ]
30
30
default = [" memchr" , " raw_os_str" ]
31
31
32
+ deprecated-byte-patterns = []
32
33
raw_os_str = []
Original file line number Diff line number Diff line change 77
77
//!
78
78
//! ### Optional Features
79
79
//!
80
+ //! - **deprecated-byte-patterns** -
81
+ //! Provides an implementation of [`Pattern`] for [`u8`] that panics when it
82
+ //! is not an ASCII character. *This feature is deprecated and was only added
83
+ //! to ease removal of this pattern type.*
84
+ //!
80
85
//! - **print\_bytes** -
81
86
//! Provides implementations of [`print_bytes::ToBytes`] for [`RawOsStr`] and
82
87
//! [`RawOsString`].
@@ -428,5 +433,6 @@ mod private {
428
433
impl Sealed for PathBuf { }
429
434
impl Sealed for & str { }
430
435
impl Sealed for & String { }
436
+ #[ cfg( feature = "deprecated-byte-patterns" ) ]
431
437
impl Sealed for u8 { }
432
438
}
Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ pub trait Encoded {
4
4
fn __get ( & self ) -> & [ u8 ] ;
5
5
}
6
6
7
+ #[ cfg( feature = "deprecated-byte-patterns" ) ]
7
8
#[ derive( Clone ) ]
8
9
pub struct EncodedByte ( [ u8 ; 1 ] ) ;
9
10
11
+ #[ cfg( feature = "deprecated-byte-patterns" ) ]
10
12
impl Encoded for EncodedByte {
11
13
#[ inline]
12
14
fn __get ( & self ) -> & [ u8 ] {
@@ -86,6 +88,11 @@ impl<'a> Pattern for &'a String {
86
88
}
87
89
}
88
90
91
+ #[ cfg( feature = "deprecated-byte-patterns" ) ]
92
+ #[ cfg_attr(
93
+ os_str_bytes_docs_rs,
94
+ doc( cfg( feature = "deprecated-byte-patterns" ) )
95
+ ) ]
89
96
impl Pattern for u8 {
90
97
#[ doc( hidden) ]
91
98
type __Encoded = EncodedByte ;
You can’t perform that action at this time.
0 commit comments