Skip to content

Commit 74d2552

Browse files
committed
std: Iterator.last_ -> .last
1 parent 1db62d8 commit 74d2552

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/libstd/iterator.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,8 @@ pub trait Iterator<A> {
381381
/// let a = [1, 2, 3, 4, 5];
382382
/// assert!(a.iter().last().get() == &5);
383383
/// ~~~
384-
// FIXME: #5898: should be called `last`
385384
#[inline]
386-
fn last_(&mut self) -> Option<A> {
385+
fn last(&mut self) -> Option<A> {
387386
let mut last = None;
388387
for x in *self { last = Some(x); }
389388
last
@@ -1712,8 +1711,8 @@ mod tests {
17121711
#[test]
17131712
fn test_iterator_last() {
17141713
let v = &[0, 1, 2, 3, 4];
1715-
assert_eq!(v.iter().last_().unwrap(), &4);
1716-
assert_eq!(v.slice(0, 1).iter().last_().unwrap(), &0);
1714+
assert_eq!(v.iter().last().unwrap(), &4);
1715+
assert_eq!(v.slice(0, 1).iter().last().unwrap(), &0);
17171716
}
17181717

17191718
#[test]

0 commit comments

Comments
 (0)