mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
doc: improve transmute example a little
This commit is contained in:
@@ -247,8 +247,8 @@
|
||||
/// ```
|
||||
/// use std::mem;
|
||||
///
|
||||
/// let v: &[u8] = unsafe { mem::transmute("L") };
|
||||
/// assert!(v == [76]);
|
||||
/// let array: &[u8] = unsafe { mem::transmute("Rust") };
|
||||
/// assert_eq!(array, [82, 117, 115, 116]);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn transmute<T,U>(e: T) -> U;
|
||||
|
||||
Reference in New Issue
Block a user