From 93569acdbe09a63a670a5a5ad6bd0a2e2d8a90b9 Mon Sep 17 00:00:00 2001 From: Kamal Marhubi Date: Mon, 28 Mar 2016 13:55:47 -0400 Subject: style: Use `iter` for IntoIterator parameter names This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`. --- src/libcore/iter.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 72421e94a43..d9d47866ea2 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2458,10 +2458,10 @@ impl<'a, I: Iterator + ?Sized> Iterator for &'a mut I { /// /// // and we'll implement FromIterator /// impl FromIterator for MyCollection { -/// fn from_iter>(iterator: I) -> Self { +/// fn from_iter>(iter: I) -> Self { /// let mut c = MyCollection::new(); /// -/// for i in iterator { +/// for i in iter { /// c.add(i); /// } /// @@ -2508,7 +2508,7 @@ pub trait FromIterator: Sized { /// assert_eq!(v, vec![5, 5, 5, 5, 5]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - fn from_iter>(iterator: T) -> Self; + fn from_iter>(iter: T) -> Self; } /// Conversion into an `Iterator`. @@ -2683,11 +2683,11 @@ impl IntoIterator for I { /// // This is a bit simpler with the concrete type signature: we can call /// // extend on anything which can be turned into an Iterator which gives /// // us i32s. Because we need i32s to put into MyCollection. -/// fn extend>(&mut self, iterable: T) { +/// fn extend>(&mut self, iter: T) { /// /// // The implementation is very straightforward: loop through the /// // iterator, and add() each element to ourselves. -/// for elem in iterable { +/// for elem in iter { /// self.add(elem); /// } /// } @@ -2727,7 +2727,7 @@ pub trait Extend { /// assert_eq!("abcdef", &message); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - fn extend>(&mut self, iterable: T); + fn extend>(&mut self, iter: T); } /// An iterator able to yield elements from both ends. -- cgit 1.4.1-3-g733a5