make Extend use IntoIterator
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
This commit is contained in:
@@ -110,7 +110,7 @@ use core::prelude::*;
|
||||
use ascii::*;
|
||||
use borrow::BorrowFrom;
|
||||
use cmp;
|
||||
use iter;
|
||||
use iter::{self, IntoIterator};
|
||||
use mem;
|
||||
use ops::{self, Deref};
|
||||
use string::CowString;
|
||||
@@ -961,7 +961,7 @@ impl<'a, P: ?Sized + 'a> iter::FromIterator<&'a P> for PathBuf where P: AsPath {
|
||||
}
|
||||
|
||||
impl<'a, P: ?Sized + 'a> iter::Extend<&'a P> for PathBuf where P: AsPath {
|
||||
fn extend<I: Iterator<Item = &'a P>>(&mut self, iter: I) {
|
||||
fn extend<I: IntoIterator<Item = &'a P>>(&mut self, iter: I) {
|
||||
for p in iter {
|
||||
self.push(p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user