diff options
| author | Lzu Tao <taolzu@gmail.com> | 2019-10-01 11:55:46 +0000 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2019-10-01 11:55:46 +0000 |
| commit | 6c1b447f2e67f5eae89394344ade698aca3ec7e6 (patch) | |
| tree | ce37bd636efc867ab133b5c78c7da745da2939ba /src/liballoc/slice.rs | |
| parent | d16ee891c63e2441ba97072a83fa79b0b6e6e01a (diff) | |
| download | rust-6c1b447f2e67f5eae89394344ade698aca3ec7e6.tar.gz rust-6c1b447f2e67f5eae89394344ade698aca3ec7e6.zip | |
Remove unneeded `fn main` blocks from docs
Diffstat (limited to 'src/liballoc/slice.rs')
| -rw-r--r-- | src/liballoc/slice.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 881d499c074..4e4a285c21d 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -412,20 +412,15 @@ impl<T> [T] { /// /// ``` /// #![feature(repeat_generic_slice)] - /// - /// fn main() { - /// assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]); - /// } + /// assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]); /// ``` /// /// A panic upon overflow: /// /// ```should_panic /// #![feature(repeat_generic_slice)] - /// fn main() { - /// // this will panic at runtime - /// b"0123456789abcdef".repeat(usize::max_value()); - /// } + /// // this will panic at runtime + /// b"0123456789abcdef".repeat(usize::max_value()); /// ``` #[unstable(feature = "repeat_generic_slice", reason = "it's on str, why not on slice?", |
