Skip to content

Commit 0a74387

Browse files
committed
Rollup merge of rust-lang#23297 - steveklabnik:examples, r=huonw
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2 parents 2c251fa + 64ab111 commit 0a74387

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+341
-341
lines changed

src/doc/trpl/comments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The other kind of comment is a doc comment. Doc comments use `///` instead of
2828
///
2929
/// * `name` - The name of the person you'd like to greet.
3030
///
31-
/// # Example
31+
/// # Examples
3232
///
3333
/// ```rust
3434
/// let name = "Steve";

src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ use heap::deallocate;
8888

8989
/// An atomically reference counted wrapper for shared state.
9090
///
91-
/// # Example
91+
/// # Examples
9292
///
9393
/// In this example, a large vector of floats is shared between several tasks.
9494
/// With simple pipes, without `Arc`, a copy would have to be made for each

src/liballoc/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<T : ?Sized> Box<T> {
133133
/// automatically managed that may lead to memory or other resource
134134
/// leak.
135135
///
136-
/// # Example
136+
/// # Examples
137137
/// ```
138138
/// use std::boxed;
139139
///

src/liballoc/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
264264
///
265265
/// If the `Rc<T>` is not unique, an `Err` is returned with the same `Rc<T>`.
266266
///
267-
/// # Example
267+
/// # Examples
268268
///
269269
/// ```
270270
/// use std::rc::{self, Rc};
@@ -298,7 +298,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
298298
///
299299
/// Returns `None` if the `Rc<T>` is not unique.
300300
///
301-
/// # Example
301+
/// # Examples
302302
///
303303
/// ```
304304
/// use std::rc::{self, Rc};

src/libcollections/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<T> ToOwned for T where T: Clone {
127127
/// is desired, `to_mut` will obtain a mutable references to an owned
128128
/// value, cloning if necessary.
129129
///
130-
/// # Example
130+
/// # Examples
131131
///
132132
/// ```rust
133133
/// use std::borrow::Cow;

src/libcollections/btree/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ impl<'a, K: Ord, V> OccupiedEntry<'a, K, V> {
11771177
impl<K, V> BTreeMap<K, V> {
11781178
/// Gets an iterator over the entries of the map.
11791179
///
1180-
/// # Example
1180+
/// # Examples
11811181
///
11821182
/// ```
11831183
/// use std::collections::BTreeMap;

src/libcollections/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ use string;
420420
///
421421
/// * args - a structure of arguments generated via the `format_args!` macro.
422422
///
423-
/// # Example
423+
/// # Examples
424424
///
425425
/// ```rust
426426
/// use std::fmt;

src/libcollections/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ macro_rules! vec {
4848
/// Use the syntax described in `std::fmt` to create a value of type `String`.
4949
/// See `std::fmt` for more information.
5050
///
51-
/// # Example
51+
/// # Examples
5252
///
5353
/// ```
5454
/// format!("test");

src/libcollections/slice.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub trait SliceExt {
277277
///
278278
/// Panics if `size` is 0.
279279
///
280-
/// # Example
280+
/// # Examples
281281
///
282282
/// Print the adjacent pairs of a slice (i.e. `[1,2]`, `[2,3]`,
283283
/// `[3,4]`):
@@ -300,7 +300,7 @@ pub trait SliceExt {
300300
///
301301
/// Panics if `size` is 0.
302302
///
303-
/// # Example
303+
/// # Examples
304304
///
305305
/// Print the slice two elements at a time (i.e. `[1,2]`,
306306
/// `[3,4]`, `[5]`):
@@ -390,7 +390,7 @@ pub trait SliceExt {
390390
/// `Err` is returned, containing the index where a matching
391391
/// element could be inserted while maintaining sorted order.
392392
///
393-
/// # Example
393+
/// # Examples
394394
///
395395
/// Looks up a series of four elements. The first is found, with a
396396
/// uniquely determined position; the second and third are not
@@ -416,7 +416,7 @@ pub trait SliceExt {
416416

417417
/// Return the number of elements in the slice
418418
///
419-
/// # Example
419+
/// # Examples
420420
///
421421
/// ```
422422
/// let a = [1, 2, 3];
@@ -427,7 +427,7 @@ pub trait SliceExt {
427427

428428
/// Returns true if the slice has a length of 0
429429
///
430-
/// # Example
430+
/// # Examples
431431
///
432432
/// ```
433433
/// let a = [1, 2, 3];
@@ -529,7 +529,7 @@ pub trait SliceExt {
529529
///
530530
/// Panics if `a` or `b` are out of bounds.
531531
///
532-
/// # Example
532+
/// # Examples
533533
///
534534
/// ```rust
535535
/// let mut v = ["a", "b", "c", "d"];
@@ -549,7 +549,7 @@ pub trait SliceExt {
549549
///
550550
/// Panics if `mid > len`.
551551
///
552-
/// # Example
552+
/// # Examples
553553
///
554554
/// ```rust
555555
/// let mut v = [1, 2, 3, 4, 5, 6];
@@ -578,7 +578,7 @@ pub trait SliceExt {
578578

579579
/// Reverse the order of elements in a slice, in place.
580580
///
581-
/// # Example
581+
/// # Examples
582582
///
583583
/// ```rust
584584
/// let mut v = [1, 2, 3];
@@ -638,7 +638,7 @@ pub trait SliceExt {
638638
/// shorter of `self.len()` and `src.len()`). Returns the number
639639
/// of elements copied.
640640
///
641-
/// # Example
641+
/// # Examples
642642
///
643643
/// ```rust
644644
/// let mut dst = [0, 0, 0];
@@ -676,7 +676,7 @@ pub trait SliceExt {
676676
/// `Err` is returned, containing the index where a matching
677677
/// element could be inserted while maintaining sorted order.
678678
///
679-
/// # Example
679+
/// # Examples
680680
///
681681
/// Looks up a series of four elements. The first is found, with a
682682
/// uniquely determined position; the second and third are not
@@ -707,7 +707,7 @@ pub trait SliceExt {
707707
/// Returns `true` if successful and `false` if the slice is at the
708708
/// last-ordered permutation.
709709
///
710-
/// # Example
710+
/// # Examples
711711
///
712712
/// ```rust
713713
/// let v: &mut [_] = &mut [0, 1, 2];
@@ -727,7 +727,7 @@ pub trait SliceExt {
727727
/// Returns `true` if successful and `false` if the slice is at the
728728
/// first-ordered permutation.
729729
///
730-
/// # Example
730+
/// # Examples
731731
///
732732
/// ```rust
733733
/// let v: &mut [_] = &mut [1, 0, 2];

src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
13771377
///
13781378
/// Will return `Err` if it's not possible to parse `self` into the type.
13791379
///
1380-
/// # Example
1380+
/// # Examples
13811381
///
13821382
/// ```
13831383
/// assert_eq!("4".parse::<u32>(), Ok(4));

src/libcore/finally.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! "finally" case. For advanced cases, the `try_finally` function can
1717
//! also be used. See that function for more details.
1818
//!
19-
//! # Example
19+
//! # Examples
2020
//!
2121
//! ```
2222
//! # #![feature(unboxed_closures)]
@@ -67,7 +67,7 @@ impl<T, F> Finally<T> for F where F: FnMut() -> T {
6767
/// function could have panicked at any point, so the values of the shared
6868
/// state may be inconsistent.
6969
///
70-
/// # Example
70+
/// # Examples
7171
///
7272
/// ```
7373
/// use std::finally::try_finally;

src/libcore/fmt/num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub struct RadixFmt<T, R>(T, R);
143143

144144
/// Constructs a radix formatter in the range of `2..36`.
145145
///
146-
/// # Example
146+
/// # Examples
147147
///
148148
/// ```
149149
/// use std::fmt::radix;

src/libcore/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,7 @@ impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>
22962296

22972297
/// An iterator that passes mutable state to a closure and yields the result.
22982298
///
2299-
/// # Example: The Fibonacci Sequence
2299+
/// # Examples
23002300
///
23012301
/// An iterator that yields sequential Fibonacci numbers, and stops on overflow.
23022302
///

src/libcore/macros.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ macro_rules! panic {
3333
/// This will invoke the `panic!` macro if the provided expression cannot be
3434
/// evaluated to `true` at runtime.
3535
///
36-
/// # Example
36+
/// # Examples
3737
///
3838
/// ```
3939
/// // the panic message for these assertions is the stringified value of the
@@ -71,7 +71,7 @@ macro_rules! assert {
7171
///
7272
/// On panic, this macro will print the values of the expressions.
7373
///
74-
/// # Example
74+
/// # Examples
7575
///
7676
/// ```
7777
/// let a = 3;
@@ -107,7 +107,7 @@ macro_rules! assert_eq {
107107
/// expensive to be present in a release build but may be helpful during
108108
/// development.
109109
///
110-
/// # Example
110+
/// # Examples
111111
///
112112
/// ```
113113
/// // the panic message for these assertions is the stringified value of the
@@ -142,7 +142,7 @@ macro_rules! debug_assert {
142142
/// expensive to be present in a release build but may be helpful during
143143
/// development.
144144
///
145-
/// # Example
145+
/// # Examples
146146
///
147147
/// ```
148148
/// let a = 3;
@@ -172,7 +172,7 @@ macro_rules! try {
172172
/// Use the `format!` syntax to write data into a buffer of type `&mut Writer`.
173173
/// See `std::fmt` for more information.
174174
///
175-
/// # Example
175+
/// # Examples
176176
///
177177
/// ```
178178
/// # #![allow(unused_must_use)]

src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<T:?Sized> MarkerTrait for T { }
288288
/// can extend `MarkerTrait`, which is equivalent to
289289
/// `PhantomFn<Self>`.
290290
///
291-
/// # Example
291+
/// # Examples
292292
///
293293
/// As an example, consider a trait with no methods like `Even`, meant
294294
/// to represent types that are "even":

0 commit comments

Comments
 (0)