mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
doc: make String::as_bytes example more simple
This commit is contained in:
parent
845cee4e20
commit
3af8e14cd1
@ -495,8 +495,7 @@ impl String {
|
||||
///
|
||||
/// ```
|
||||
/// let s = String::from("hello");
|
||||
/// let b: &[_] = &[104, 101, 108, 108, 111];
|
||||
/// assert_eq!(s.as_bytes(), b);
|
||||
/// assert_eq!(s.as_bytes(), [104, 101, 108, 108, 111]);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
Loading…
Reference in New Issue
Block a user