@@ -114,18 +114,19 @@ impl [u8] {
114
114
/// Returns a byte slice with leading ASCII whitespace bytes removed.
115
115
///
116
116
/// 'Whitespace' refers to the definition used by
117
- /// `u8::is_ascii_whitespace`.
117
+ /// [`u8::is_ascii_whitespace`].
118
+ ///
119
+ /// [`u8::is_ascii_whitespace`]: u8::is_ascii_whitespace
118
120
///
119
121
/// # Examples
120
122
///
121
123
/// ```
122
- /// #![feature(byte_slice_trim_ascii)]
123
- ///
124
124
/// assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
125
125
/// assert_eq!(b" ".trim_ascii_start(), b"");
126
126
/// assert_eq!(b"".trim_ascii_start(), b"");
127
127
/// ```
128
- #[ unstable( feature = "byte_slice_trim_ascii" , issue = "94035" ) ]
128
+ #[ stable( feature = "byte_slice_trim_ascii" , since = "CURRENT_RUSTC_VERSION" ) ]
129
+ #[ rustc_const_stable( feature = "byte_slice_trim_ascii" , since = "CURRENT_RUSTC_VERSION" ) ]
129
130
#[ inline]
130
131
pub const fn trim_ascii_start ( & self ) -> & [ u8 ] {
131
132
let mut bytes = self ;
@@ -144,18 +145,19 @@ impl [u8] {
144
145
/// Returns a byte slice with trailing ASCII whitespace bytes removed.
145
146
///
146
147
/// 'Whitespace' refers to the definition used by
147
- /// `u8::is_ascii_whitespace`.
148
+ /// [`u8::is_ascii_whitespace`].
149
+ ///
150
+ /// [`u8::is_ascii_whitespace`]: u8::is_ascii_whitespace
148
151
///
149
152
/// # Examples
150
153
///
151
154
/// ```
152
- /// #![feature(byte_slice_trim_ascii)]
153
- ///
154
155
/// assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
155
156
/// assert_eq!(b" ".trim_ascii_end(), b"");
156
157
/// assert_eq!(b"".trim_ascii_end(), b"");
157
158
/// ```
158
- #[ unstable( feature = "byte_slice_trim_ascii" , issue = "94035" ) ]
159
+ #[ stable( feature = "byte_slice_trim_ascii" , since = "CURRENT_RUSTC_VERSION" ) ]
160
+ #[ rustc_const_stable( feature = "byte_slice_trim_ascii" , since = "CURRENT_RUSTC_VERSION" ) ]
159
161
#[ inline]
160
162
pub const fn trim_ascii_end ( & self ) -> & [ u8 ] {
161
163
let mut bytes = self ;
@@ -175,18 +177,19 @@ impl [u8] {
175
177
/// removed.
176
178
///
177
179
/// 'Whitespace' refers to the definition used by
178
- /// `u8::is_ascii_whitespace`.
180
+ /// [`u8::is_ascii_whitespace`].
181
+ ///
182
+ /// [`u8::is_ascii_whitespace`]: u8::is_ascii_whitespace
179
183
///
180
184
/// # Examples
181
185
///
182
186
/// ```
183
- /// #![feature(byte_slice_trim_ascii)]
184
- ///
185
187
/// assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
186
188
/// assert_eq!(b" ".trim_ascii(), b"");
187
189
/// assert_eq!(b"".trim_ascii(), b"");
188
190
/// ```
189
- #[ unstable( feature = "byte_slice_trim_ascii" , issue = "94035" ) ]
191
+ #[ stable( feature = "byte_slice_trim_ascii" , since = "CURRENT_RUSTC_VERSION" ) ]
192
+ #[ rustc_const_stable( feature = "byte_slice_trim_ascii" , since = "CURRENT_RUSTC_VERSION" ) ]
190
193
#[ inline]
191
194
pub const fn trim_ascii ( & self ) -> & [ u8 ] {
192
195
self . trim_ascii_start ( ) . trim_ascii_end ( )
0 commit comments