@@ -139,7 +139,7 @@ impl String {
139
139
/// ```rust
140
140
/// let input = b"Hello \xF0\x90\x80World";
141
141
/// 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");
143
143
/// ```
144
144
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
145
145
pub fn from_utf8_lossy < ' a > ( v : & ' a [ u8 ] ) -> Cow < ' a , str > {
@@ -355,7 +355,7 @@ impl String {
355
355
/// ```
356
356
/// let mut s = String::from_str("foo");
357
357
/// s.push_str("bar");
358
- /// assert_eq!(s.as_slice() , "foobar");
358
+ /// assert_eq!(s, "foobar");
359
359
/// ```
360
360
#[ inline]
361
361
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -450,7 +450,7 @@ impl String {
450
450
/// s.push('1');
451
451
/// s.push('2');
452
452
/// s.push('3');
453
- /// assert_eq!(s.as_slice() , "abc123");
453
+ /// assert_eq!(s, "abc123");
454
454
/// ```
455
455
#[ inline]
456
456
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -503,7 +503,7 @@ impl String {
503
503
/// ```
504
504
/// let mut s = String::from_str("hello");
505
505
/// s.truncate(2);
506
- /// assert_eq!(s.as_slice() , "he");
506
+ /// assert_eq!(s, "he");
507
507
/// ```
508
508
#[ inline]
509
509
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -622,7 +622,7 @@ impl String {
622
622
/// assert!(vec == &[104, 101, 108, 108, 111]);
623
623
/// vec.reverse();
624
624
/// }
625
- /// assert_eq!(s.as_slice() , "olleh");
625
+ /// assert_eq!(s, "olleh");
626
626
/// ```
627
627
#[ inline]
628
628
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
0 commit comments