Skip to content

Commit c330046

Browse files
add fn main wrappers to enable Rust Playground "Run" button
1 parent 7782838 commit c330046

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/libcore/ops.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,17 @@
145145
//!
146146
//! ```rust
147147
//! #![feature(inclusive_range_syntax)]
148+
//! fn main() {
149+
//! let arr = [0, 1, 2, 3, 4];
148150
//!
149-
//! let arr = [0, 1, 2, 3, 4];
150-
//!
151-
//! assert_eq!(arr[ .. ], [0,1,2,3,4]); // RangeFull
152-
//! assert_eq!(arr[ ..3], [0,1,2 ]); // RangeTo
153-
//! assert_eq!(arr[1.. ], [ 1,2,3,4]); // RangeFrom
154-
//! assert_eq!(arr[1..3], [ 1,2 ]); // Range
151+
//! assert_eq!(arr[ .. ], [0,1,2,3,4]); // RangeFull
152+
//! assert_eq!(arr[ ..3], [0,1,2 ]); // RangeTo
153+
//! assert_eq!(arr[1.. ], [ 1,2,3,4]); // RangeFrom
154+
//! assert_eq!(arr[1..3], [ 1,2 ]); // Range
155155
//!
156-
//! assert_eq!(arr[ ...3], [0,1,2,3 ]); // RangeToIncusive
157-
//! assert_eq!(arr[1...3], [ 1,2,3 ]); // RangeInclusive
156+
//! assert_eq!(arr[ ...3], [0,1,2,3 ]); // RangeToIncusive
157+
//! assert_eq!(arr[1...3], [ 1,2,3 ]); // RangeInclusive
158+
//! }
158159
//! ```
159160
160161
#![stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)