Skip to content

Example -> Examples #23297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doc/trpl/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The other kind of comment is a doc comment. Doc comments use `///` instead of
///
/// * `name` - The name of the person you'd like to greet.
///
/// # Example
/// # Examples
///
/// ```rust
/// let name = "Steve";
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ use heap::deallocate;

/// An atomically reference counted wrapper for shared state.
///
/// # Example
/// # Examples
///
/// In this example, a large vector of floats is shared between several tasks.
/// With simple pipes, without `Arc`, a copy would have to be made for each
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<T : ?Sized> Box<T> {
/// automatically managed that may lead to memory or other resource
/// leak.
///
/// # Example
/// # Examples
/// ```
/// use std::boxed;
///
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
///
/// If the `Rc<T>` is not unique, an `Err` is returned with the same `Rc<T>`.
///
/// # Example
/// # Examples
///
/// ```
/// use std::rc::{self, Rc};
Expand Down Expand Up @@ -298,7 +298,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
///
/// Returns `None` if the `Rc<T>` is not unique.
///
/// # Example
/// # Examples
///
/// ```
/// use std::rc::{self, Rc};
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<T> ToOwned for T where T: Clone {
/// is desired, `to_mut` will obtain a mutable references to an owned
/// value, cloning if necessary.
///
/// # Example
/// # Examples
///
/// ```rust
/// use std::borrow::Cow;
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ impl<'a, K: Ord, V> OccupiedEntry<'a, K, V> {
impl<K, V> BTreeMap<K, V> {
/// Gets an iterator over the entries of the map.
///
/// # Example
/// # Examples
///
/// ```
/// use std::collections::BTreeMap;
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ use string;
///
/// * args - a structure of arguments generated via the `format_args!` macro.
///
/// # Example
/// # Examples
///
/// ```rust
/// use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ macro_rules! vec {
/// Use the syntax described in `std::fmt` to create a value of type `String`.
/// See `std::fmt` for more information.
///
/// # Example
/// # Examples
///
/// ```
/// format!("test");
Expand Down
24 changes: 12 additions & 12 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ pub trait SliceExt {
///
/// Panics if `size` is 0.
///
/// # Example
/// # Examples
///
/// Print the adjacent pairs of a slice (i.e. `[1,2]`, `[2,3]`,
/// `[3,4]`):
Expand All @@ -300,7 +300,7 @@ pub trait SliceExt {
///
/// Panics if `size` is 0.
///
/// # Example
/// # Examples
///
/// Print the slice two elements at a time (i.e. `[1,2]`,
/// `[3,4]`, `[5]`):
Expand Down Expand Up @@ -390,7 +390,7 @@ pub trait SliceExt {
/// `Err` is returned, containing the index where a matching
/// element could be inserted while maintaining sorted order.
///
/// # Example
/// # Examples
///
/// Looks up a series of four elements. The first is found, with a
/// uniquely determined position; the second and third are not
Expand All @@ -416,7 +416,7 @@ pub trait SliceExt {

/// Return the number of elements in the slice
///
/// # Example
/// # Examples
///
/// ```
/// let a = [1, 2, 3];
Expand All @@ -427,7 +427,7 @@ pub trait SliceExt {

/// Returns true if the slice has a length of 0
///
/// # Example
/// # Examples
///
/// ```
/// let a = [1, 2, 3];
Expand Down Expand Up @@ -529,7 +529,7 @@ pub trait SliceExt {
///
/// Panics if `a` or `b` are out of bounds.
///
/// # Example
/// # Examples
///
/// ```rust
/// let mut v = ["a", "b", "c", "d"];
Expand All @@ -549,7 +549,7 @@ pub trait SliceExt {
///
/// Panics if `mid > len`.
///
/// # Example
/// # Examples
///
/// ```rust
/// let mut v = [1, 2, 3, 4, 5, 6];
Expand Down Expand Up @@ -578,7 +578,7 @@ pub trait SliceExt {

/// Reverse the order of elements in a slice, in place.
///
/// # Example
/// # Examples
///
/// ```rust
/// let mut v = [1, 2, 3];
Expand Down Expand Up @@ -638,7 +638,7 @@ pub trait SliceExt {
/// shorter of `self.len()` and `src.len()`). Returns the number
/// of elements copied.
///
/// # Example
/// # Examples
///
/// ```rust
/// let mut dst = [0, 0, 0];
Expand Down Expand Up @@ -676,7 +676,7 @@ pub trait SliceExt {
/// `Err` is returned, containing the index where a matching
/// element could be inserted while maintaining sorted order.
///
/// # Example
/// # Examples
///
/// Looks up a series of four elements. The first is found, with a
/// uniquely determined position; the second and third are not
Expand Down Expand Up @@ -707,7 +707,7 @@ pub trait SliceExt {
/// Returns `true` if successful and `false` if the slice is at the
/// last-ordered permutation.
///
/// # Example
/// # Examples
///
/// ```rust
/// let v: &mut [_] = &mut [0, 1, 2];
Expand All @@ -727,7 +727,7 @@ pub trait SliceExt {
/// Returns `true` if successful and `false` if the slice is at the
/// first-ordered permutation.
///
/// # Example
/// # Examples
///
/// ```rust
/// let v: &mut [_] = &mut [1, 0, 2];
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
///
/// Will return `Err` if it's not possible to parse `self` into the type.
///
/// # Example
/// # Examples
///
/// ```
/// assert_eq!("4".parse::<u32>(), Ok(4));
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/finally.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! "finally" case. For advanced cases, the `try_finally` function can
//! also be used. See that function for more details.
//!
//! # Example
//! # Examples
//!
//! ```
//! # #![feature(unboxed_closures)]
Expand Down Expand Up @@ -67,7 +67,7 @@ impl<T, F> Finally<T> for F where F: FnMut() -> T {
/// function could have panicked at any point, so the values of the shared
/// state may be inconsistent.
///
/// # Example
/// # Examples
///
/// ```
/// use std::finally::try_finally;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub struct RadixFmt<T, R>(T, R);

/// Constructs a radix formatter in the range of `2..36`.
///
/// # Example
/// # Examples
///
/// ```
/// use std::fmt::radix;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>

/// An iterator that passes mutable state to a closure and yields the result.
///
/// # Example: The Fibonacci Sequence
/// # Examples
///
/// An iterator that yields sequential Fibonacci numbers, and stops on overflow.
///
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ macro_rules! panic {
/// This will invoke the `panic!` macro if the provided expression cannot be
/// evaluated to `true` at runtime.
///
/// # Example
/// # Examples
///
/// ```
/// // the panic message for these assertions is the stringified value of the
Expand Down Expand Up @@ -71,7 +71,7 @@ macro_rules! assert {
///
/// On panic, this macro will print the values of the expressions.
///
/// # Example
/// # Examples
///
/// ```
/// let a = 3;
Expand Down Expand Up @@ -107,7 +107,7 @@ macro_rules! assert_eq {
/// expensive to be present in a release build but may be helpful during
/// development.
///
/// # Example
/// # Examples
///
/// ```
/// // the panic message for these assertions is the stringified value of the
Expand Down Expand Up @@ -142,7 +142,7 @@ macro_rules! debug_assert {
/// expensive to be present in a release build but may be helpful during
/// development.
///
/// # Example
/// # Examples
///
/// ```
/// let a = 3;
Expand Down Expand Up @@ -172,7 +172,7 @@ macro_rules! try {
/// Use the `format!` syntax to write data into a buffer of type `&mut Writer`.
/// See `std::fmt` for more information.
///
/// # Example
/// # Examples
///
/// ```
/// # #![allow(unused_must_use)]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl<T:?Sized> MarkerTrait for T { }
/// can extend `MarkerTrait`, which is equivalent to
/// `PhantomFn<Self>`.
///
/// # Example
/// # Examples
///
/// As an example, consider a trait with no methods like `Even`, meant
/// to represent types that are "even":
Expand Down
Loading