Skip to content

Commit 790bfe8

Browse files
authored
Unrolled build for rust-lang#137126
Rollup merge of rust-lang#137126 - m4rch3n1ng:fix-inherent-str-docs, r=Amanieu fix docs for inherent str constructors related to rust-lang#131114 when implementing inherent str constructors in rust-lang#136517, i forgot to change the docs, so the code examples still imported the `std::str` module and used the constructor from there, instead of using "itself" (the inherent constructor).
2 parents 827a0d6 + 345c313 commit 790bfe8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

library/core/src/str/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl str {
198198
/// Basic usage:
199199
///
200200
/// ```
201-
/// use std::str;
201+
/// #![feature(inherent_str_constructors)]
202202
///
203203
/// // some bytes, in a vector
204204
/// let sparkle_heart = vec![240, 159, 146, 150];
@@ -207,13 +207,13 @@ impl str {
207207
/// let sparkle_heart = str::from_utf8(&sparkle_heart)?;
208208
///
209209
/// assert_eq!("💖", sparkle_heart);
210-
/// # Ok::<_, str::Utf8Error>(())
210+
/// # Ok::<_, std::str::Utf8Error>(())
211211
/// ```
212212
///
213213
/// Incorrect bytes:
214214
///
215215
/// ```
216-
/// use std::str;
216+
/// #![feature(inherent_str_constructors)]
217217
///
218218
/// // some invalid bytes, in a vector
219219
/// let sparkle_heart = vec![0, 159, 146, 150];
@@ -227,7 +227,7 @@ impl str {
227227
/// A "stack allocated string":
228228
///
229229
/// ```
230-
/// use std::str;
230+
/// #![feature(inherent_str_constructors)]
231231
///
232232
/// // some bytes, in a stack-allocated array
233233
/// let sparkle_heart = [240, 159, 146, 150];
@@ -250,7 +250,7 @@ impl str {
250250
/// Basic usage:
251251
///
252252
/// ```
253-
/// use std::str;
253+
/// #![feature(inherent_str_constructors)]
254254
///
255255
/// // "Hello, Rust!" as a mutable vector
256256
/// let mut hellorust = vec![72, 101, 108, 108, 111, 44, 32, 82, 117, 115, 116, 33];
@@ -264,7 +264,7 @@ impl str {
264264
/// Incorrect bytes:
265265
///
266266
/// ```
267-
/// use std::str;
267+
/// #![feature(inherent_str_constructors)]
268268
///
269269
/// // Some invalid bytes in a mutable vector
270270
/// let mut invalid = vec![128, 223];
@@ -294,7 +294,7 @@ impl str {
294294
/// Basic usage:
295295
///
296296
/// ```
297-
/// use std::str;
297+
/// #![feature(inherent_str_constructors)]
298298
///
299299
/// // some bytes, in a vector
300300
/// let sparkle_heart = vec![240, 159, 146, 150];
@@ -324,7 +324,7 @@ impl str {
324324
/// Basic usage:
325325
///
326326
/// ```
327-
/// use std::str;
327+
/// #![feature(inherent_str_constructors)]
328328
///
329329
/// let mut heart = vec![240, 159, 146, 150];
330330
/// let heart = unsafe { str::from_utf8_unchecked_mut(&mut heart) };

0 commit comments

Comments
 (0)