aboutsummaryrefslogtreecommitdiff
path: root/libcore/iter/iterator.rs
diff options
context:
space:
mode:
authorpravic <[email protected]>2016-06-06 23:07:53 +0300
committerpravic <[email protected]>2016-06-06 23:07:53 +0300
commitf2db0929feeb53567655dbdebba7e6b1c3f2f69e (patch)
treec2cf041f838782f9ddd8994146f52e8f498bfe07 /libcore/iter/iterator.rs
parentadd 'netio' native import library (diff)
parentMerge branch 'nofp_patch' into libcore_nofp (diff)
downloadkmd-env-rs-master.tar.xz
kmd-env-rs-master.zip
Merge branch 'libcore_nofp'HEADmaster
Diffstat (limited to 'libcore/iter/iterator.rs')
-rw-r--r--libcore/iter/iterator.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcore/iter/iterator.rs b/libcore/iter/iterator.rs
index 2033ae5..71ca5cc 100644
--- a/libcore/iter/iterator.rs
+++ b/libcore/iter/iterator.rs
@@ -172,6 +172,7 @@ pub trait Iterator {
/// assert_eq!(a.iter().count(), 5);
/// ```
#[inline]
+ #[rustc_inherit_overflow_checks]
#[stable(feature = "rust1", since = "1.0.0")]
fn count(self) -> usize where Self: Sized {
// Might overflow.
@@ -214,7 +215,7 @@ pub trait Iterator {
/// Like most indexing operations, the count starts from zero, so `nth(0)`
/// returns the first value, `nth(1)` the second, and so on.
///
- /// `nth()` will return `None` if `n` is larger than the length of the
+ /// `nth()` will return `None` if `n` is greater than or equal to the length of the
/// iterator.
///
/// # Examples
@@ -237,7 +238,7 @@ pub trait Iterator {
/// assert_eq!(iter.nth(1), None);
/// ```
///
- /// Returning `None` if there are less than `n` elements:
+ /// Returning `None` if there are less than `n + 1` elements:
///
/// ```
/// let a = [1, 2, 3];