doc: improve transmute example a little

This commit is contained in:
Tshepang Lekhonkhobe 2015-08-19 19:43:18 +02:00
parent aca2057ed5
commit b667ff7d6e

View File

@ -247,8 +247,8 @@ extern "rust-intrinsic" {
/// ```
/// 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;