Skip to content

Commit b6b2977

Browse files
committed
---
yaml --- r: 225233 b: refs/heads/stable c: e9005fb h: refs/heads/master i: 225231: d0c072b v: v3
1 parent 2602dae commit b6b2977

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: c7f92018accf8fd27fdac5acbe7fe3506c338ed1
32+
refs/heads/stable: e9005fb43e57cdd619dc8b0030a81e3a3d76262b
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/src/libcore/iter.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,19 @@ pub trait Iterator {
10091009
(ts, us)
10101010
}
10111011

1012-
/// Creates an iterator that clones the elements it yields. Useful for
1013-
/// converting an Iterator<&T> to an Iterator<T>.
1012+
/// Creates an iterator that clones the elements it yields.
1013+
///
1014+
/// This is useful for converting an Iterator<&T> to an Iterator<T>,
1015+
/// so it's a more convenient form of `map(|&x| x)`.
1016+
///
1017+
/// # Examples
1018+
///
1019+
/// ```
1020+
/// let a = [0, 1, 2];
1021+
/// let v_cloned: Vec<_> = a.iter().cloned().collect();
1022+
/// let v_map: Vec<_> = a.iter().map(|&x| x).collect();
1023+
/// assert_eq!(v_cloned, v_map);
1024+
/// ```
10141025
#[stable(feature = "rust1", since = "1.0.0")]
10151026
fn cloned<'a, T: 'a>(self) -> Cloned<Self>
10161027
where Self: Sized + Iterator<Item=&'a T>, T: Clone
@@ -1057,7 +1068,7 @@ pub trait Iterator {
10571068
/// # #![feature(core)]
10581069
///
10591070
/// let a = [1, 2, 3, 4, 5];
1060-
/// let mut it = a.iter().cloned();
1071+
/// let it = a.iter();
10611072
/// assert_eq!(it.sum::<i32>(), 15);
10621073
/// ```
10631074
#[unstable(feature="core")]

branches/stable/src/libstd/path.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ mod platform {
258258
/// Path prefixes (Windows only).
259259
///
260260
/// Windows uses a variety of path styles, including references to drive
261-
/// volumes (like `C:`), network shared (like `\\server\share`) and
261+
/// volumes (like `C:`), network shared folders (like `\\server\share`) and
262262
/// others. In addition, some path prefixes are "verbatim", in which case
263263
/// `/` is *not* treated as a separator and essentially no normalization is
264264
/// performed.
@@ -312,14 +312,14 @@ impl<'a> Prefix<'a> {
312312

313313
}
314314

315-
/// Determines if the prefix is verbatim, i.e. begins `\\?\`.
315+
/// Determines if the prefix is verbatim, i.e. begins with `\\?\`.
316316
#[inline]
317317
#[stable(feature = "rust1", since = "1.0.0")]
318318
pub fn is_verbatim(&self) -> bool {
319319
use self::Prefix::*;
320320
match *self {
321321
Verbatim(_) | VerbatimDisk(_) | VerbatimUNC(_, _) => true,
322-
_ => false
322+
_ => false,
323323
}
324324
}
325325

0 commit comments

Comments
 (0)