@@ -121,9 +121,6 @@ impl String {
121
121
/// # Examples
122
122
///
123
123
/// ```
124
- /// # #![feature(core)]
125
- /// use std::str::Utf8Error;
126
- ///
127
124
/// let hello_vec = vec![104, 101, 108, 108, 111];
128
125
/// let s = String::from_utf8(hello_vec).unwrap();
129
126
/// assert_eq!(s, "hello");
@@ -346,8 +343,7 @@ impl String {
346
343
/// # Examples
347
344
///
348
345
/// ```
349
- /// # #![feature(collections)]
350
- /// let s = String::from_str("hello");
346
+ /// let s = String::from("hello");
351
347
/// let bytes = s.into_bytes();
352
348
/// assert_eq!(bytes, [104, 101, 108, 108, 111]);
353
349
/// ```
@@ -370,8 +366,7 @@ impl String {
370
366
/// # Examples
371
367
///
372
368
/// ```
373
- /// # #![feature(collections)]
374
- /// let mut s = String::from_str("foo");
369
+ /// let mut s = String::from("foo");
375
370
/// s.push_str("bar");
376
371
/// assert_eq!(s, "foobar");
377
372
/// ```
@@ -447,8 +442,7 @@ impl String {
447
442
/// # Examples
448
443
///
449
444
/// ```
450
- /// # #![feature(collections)]
451
- /// let mut s = String::from_str("foo");
445
+ /// let mut s = String::from("foo");
452
446
/// s.reserve(100);
453
447
/// assert!(s.capacity() >= 100);
454
448
/// s.shrink_to_fit();
@@ -465,8 +459,7 @@ impl String {
465
459
/// # Examples
466
460
///
467
461
/// ```
468
- /// # #![feature(collections)]
469
- /// let mut s = String::from_str("abc");
462
+ /// let mut s = String::from("abc");
470
463
/// s.push('1');
471
464
/// s.push('2');
472
465
/// s.push('3');
@@ -501,8 +494,7 @@ impl String {
501
494
/// # Examples
502
495
///
503
496
/// ```
504
- /// # #![feature(collections)]
505
- /// let s = String::from_str("hello");
497
+ /// let s = String::from("hello");
506
498
/// let b: &[_] = &[104, 101, 108, 108, 111];
507
499
/// assert_eq!(s.as_bytes(), b);
508
500
/// ```
@@ -522,8 +514,7 @@ impl String {
522
514
/// # Examples
523
515
///
524
516
/// ```
525
- /// # #![feature(collections)]
526
- /// let mut s = String::from_str("hello");
517
+ /// let mut s = String::from("hello");
527
518
/// s.truncate(2);
528
519
/// assert_eq!(s, "he");
529
520
/// ```
@@ -540,8 +531,7 @@ impl String {
540
531
/// # Examples
541
532
///
542
533
/// ```
543
- /// # #![feature(collections)]
544
- /// let mut s = String::from_str("foo");
534
+ /// let mut s = String::from("foo");
545
535
/// assert_eq!(s.pop(), Some('o'));
546
536
/// assert_eq!(s.pop(), Some('o'));
547
537
/// assert_eq!(s.pop(), Some('f'));
@@ -578,8 +568,7 @@ impl String {
578
568
/// # Examples
579
569
///
580
570
/// ```
581
- /// # #![feature(collections)]
582
- /// let mut s = String::from_str("foo");
571
+ /// let mut s = String::from("foo");
583
572
/// assert_eq!(s.remove(0), 'f');
584
573
/// assert_eq!(s.remove(1), 'o');
585
574
/// assert_eq!(s.remove(0), 'o');
@@ -641,8 +630,7 @@ impl String {
641
630
/// # Examples
642
631
///
643
632
/// ```
644
- /// # #![feature(collections)]
645
- /// let mut s = String::from_str("hello");
633
+ /// let mut s = String::from("hello");
646
634
/// unsafe {
647
635
/// let vec = s.as_mut_vec();
648
636
/// assert!(vec == &[104, 101, 108, 108, 111]);
0 commit comments