Skip to content

Commit

Permalink
doc: add some array usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tshepang committed Jul 5, 2015
1 parent 912ab64 commit c4c5c2d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/libstd/array.rs
Expand Up @@ -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")]

0 comments on commit c4c5c2d

Please sign in to comment.