Skip to content

Commit c779782

Browse files
committed
Add inline to a few more methods
1 parent ba1a6f3 commit c779782

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/iter/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -470,18 +470,21 @@ impl<I> DoubleEndedIterator for Rev<I> where I: DoubleEndedIterator {
470470
#[inline]
471471
fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item> { self.iter.nth(n) }
472472

473+
#[inline]
473474
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
474475
Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Ok=B>
475476
{
476477
self.iter.try_fold(init, f)
477478
}
478479

480+
#[inline]
479481
fn rfold<Acc, F>(self, init: Acc, f: F) -> Acc
480482
where F: FnMut(Acc, Self::Item) -> Acc,
481483
{
482484
self.iter.fold(init, f)
483485
}
484486

487+
#[inline]
485488
fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
486489
where P: FnMut(&Self::Item) -> bool
487490
{
@@ -493,10 +496,12 @@ impl<I> DoubleEndedIterator for Rev<I> where I: DoubleEndedIterator {
493496
impl<I> ExactSizeIterator for Rev<I>
494497
where I: ExactSizeIterator + DoubleEndedIterator
495498
{
499+
#[inline]
496500
fn len(&self) -> usize {
497501
self.iter.len()
498502
}
499503

504+
#[inline]
500505
fn is_empty(&self) -> bool {
501506
self.iter.is_empty()
502507
}

0 commit comments

Comments
 (0)