about summary refs log tree commit diff
path: root/src/libstd/array.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-09 14:50:32 +0000
committerbors <bors@rust-lang.org>2015-07-09 14:50:32 +0000
commit92a95fe5507a41bdfb055913bec1be24509a5146 (patch)
treeb6a446117758e3b77eab6b62aebf11f3c66e737b /src/libstd/array.rs
parent5b15923026a8952f1b4939d73c69e01e04e3788b (diff)
parentc4c5c2dd20aaaddb7c0afdba06ec319340842443 (diff)
downloadrust-92a95fe5507a41bdfb055913bec1be24509a5146.tar.gz
rust-92a95fe5507a41bdfb055913bec1be24509a5146.zip
Auto merge of #26814 - tshepang:array-examples, r=bluss
Diffstat (limited to 'src/libstd/array.rs')
-rw-r--r--src/libstd/array.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstd/array.rs b/src/libstd/array.rs
index a6b8cd71a3b..6887e398fd4 100644
--- a/src/libstd/array.rs
+++ b/src/libstd/array.rs
@@ -9,5 +9,18 @@
 // except according to those terms.
 
 //! The fixed-size array type (`[T; n]`).
+//!
+//! Some usage examples:
+//!
+//! ```
+//! let array: [i32; 3] = [0, 1, 2];
+//!
+//! assert_eq!(0, array[0]);
+//! assert_eq!([0, 1], &array[..2]);
+//!
+//! for x in &array {
+//!     println!("{}", x);
+//! }
+//! ```
 
 #![doc(primitive = "array")]