Skip to content

Commit 3af8e14

Browse files
committed
doc: make String::as_bytes example more simple
1 parent 845cee4 commit 3af8e14

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libcollections/string.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@ impl String {
495495
///
496496
/// ```
497497
/// let s = String::from("hello");
498-
/// let b: &[_] = &[104, 101, 108, 108, 111];
499-
/// assert_eq!(s.as_bytes(), b);
498+
/// assert_eq!(s.as_bytes(), [104, 101, 108, 108, 111]);
500499
/// ```
501500
#[inline]
502501
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)