about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorTshepang Lekhonkhobe <tshepang@gmail.com>2015-07-05 13:01:42 +0200
committerTshepang Lekhonkhobe <tshepang@gmail.com>2015-07-05 13:04:04 +0200
commit72c027535a33dcf788fb326d967ca2a4e3debe5c (patch)
treefad3144c093a2cc4e4a7590df24a38ec0e8a2912 /src/doc
parent912ab64a0de2c121a1c9f10bb1dbe75983b78c73 (diff)
downloadrust-72c027535a33dcf788fb326d967ca2a4e3debe5c.tar.gz
rust-72c027535a33dcf788fb326d967ca2a4e3debe5c.zip
reference: make tuple usage examples more meaningful
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/reference.md9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index a3e13acccae..fa41a88b2b6 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -3322,10 +3322,13 @@ An example of a tuple type and its use:
 
 ```
 type Pair<'a> = (i32, &'a str);
-let p: Pair<'static> = (10, "hello");
+let p: Pair<'static> = (10, "ten");
 let (a, b) = p;
-assert!(b != "world");
-assert!(p.0 == 10);
+
+assert_eq!(a, 10);
+assert_eq!(b, "ten");
+assert_eq!(p.0, 10);
+assert_eq!(p.1, "ten");
 ```
 
 For historical reasons and convenience, the tuple type with no elements (`()`)