Skip to content

Commit

Permalink
add fn main wrappers to enable Rust Playground "Run" button
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-piziak committed Aug 30, 2016
1 parent 7782838 commit c330046
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,17 @@
//!
//! ```rust
//! #![feature(inclusive_range_syntax)]
//! fn main() {
//! let arr = [0, 1, 2, 3, 4];
//!
//! let arr = [0, 1, 2, 3, 4];
//!
//! assert_eq!(arr[ .. ], [0,1,2,3,4]); // RangeFull
//! assert_eq!(arr[ ..3], [0,1,2 ]); // RangeTo
//! assert_eq!(arr[1.. ], [ 1,2,3,4]); // RangeFrom
//! assert_eq!(arr[1..3], [ 1,2 ]); // Range
//! assert_eq!(arr[ .. ], [0,1,2,3,4]); // RangeFull
//! assert_eq!(arr[ ..3], [0,1,2 ]); // RangeTo
//! assert_eq!(arr[1.. ], [ 1,2,3,4]); // RangeFrom
//! assert_eq!(arr[1..3], [ 1,2 ]); // Range
//!
//! assert_eq!(arr[ ...3], [0,1,2,3 ]); // RangeToIncusive
//! assert_eq!(arr[1...3], [ 1,2,3 ]); // RangeInclusive
//! assert_eq!(arr[ ...3], [0,1,2,3 ]); // RangeToIncusive
//! assert_eq!(arr[1...3], [ 1,2,3 ]); // RangeInclusive
//! }
//! ```

#![stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit c330046

Please sign in to comment.