@@ -139,7 +139,7 @@ impl String {
139139 /// ```rust
140140 /// let input = b"Hello \xF0\x90\x80World";
141141 /// let output = String::from_utf8_lossy(input);
142- /// assert_eq!(output.as_slice() , "Hello \u{FFFD}World");
142+ /// assert_eq!(output, "Hello \u{FFFD}World");
143143 /// ```
144144 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
145145 pub fn from_utf8_lossy < ' a > ( v : & ' a [ u8 ] ) -> Cow < ' a , str > {
@@ -355,7 +355,7 @@ impl String {
355355 /// ```
356356 /// let mut s = String::from_str("foo");
357357 /// s.push_str("bar");
358- /// assert_eq!(s.as_slice() , "foobar");
358+ /// assert_eq!(s, "foobar");
359359 /// ```
360360 #[ inline]
361361 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -450,7 +450,7 @@ impl String {
450450 /// s.push('1');
451451 /// s.push('2');
452452 /// s.push('3');
453- /// assert_eq!(s.as_slice() , "abc123");
453+ /// assert_eq!(s, "abc123");
454454 /// ```
455455 #[ inline]
456456 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -503,7 +503,7 @@ impl String {
503503 /// ```
504504 /// let mut s = String::from_str("hello");
505505 /// s.truncate(2);
506- /// assert_eq!(s.as_slice() , "he");
506+ /// assert_eq!(s, "he");
507507 /// ```
508508 #[ inline]
509509 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -622,7 +622,7 @@ impl String {
622622 /// assert!(vec == &[104, 101, 108, 108, 111]);
623623 /// vec.reverse();
624624 /// }
625- /// assert_eq!(s.as_slice() , "olleh");
625+ /// assert_eq!(s, "olleh");
626626 /// ```
627627 #[ inline]
628628 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
0 commit comments