]> git.lizzy.rs Git - rust.git/commitdiff
doc: Fix transmute example
authorKeegan McAllister <kmcallister@mozilla.com>
Thu, 22 Aug 2013 19:06:41 +0000 (12:06 -0700)
committerKeegan McAllister <kmcallister@mozilla.com>
Thu, 22 Aug 2013 19:06:41 +0000 (12:06 -0700)
src/libstd/cast.rs

index 9d1d6e65901ae267af396cc8d27cb4f0270f3fd6..825d0147c80e2f669a27ebcbab0ead46769f3a11 100644 (file)
@@ -66,7 +66,10 @@ pub unsafe fn unsafe_copy<T>(thing: &T) -> T {
  *
  * # Example
  *
- *     assert!(transmute("L") == ~[76u8, 0u8]);
+ * ~~~ {.rust}
+ * let v: &[u8] = transmute("L");
+ * assert!(v == [76u8]);
+ * ~~~
  */
 #[inline]
 pub unsafe fn transmute<L, G>(thing: L) -> G {