diff options
| author | Kamal Marhubi <kamal@marhubi.com> | 2016-03-28 13:55:47 -0400 |
|---|---|---|
| committer | Kamal Marhubi <kamal@marhubi.com> | 2016-03-28 13:59:38 -0400 |
| commit | 93569acdbe09a63a670a5a5ad6bd0a2e2d8a90b9 (patch) | |
| tree | 45708e55bd2773669c964b2d226a37fb25d06acf /src/libstd | |
| parent | 3602f34e9cfe542210b6ac4302ae8d0f0799965b (diff) | |
| download | rust-93569acdbe09a63a670a5a5ad6bd0a2e2d8a90b9.tar.gz rust-93569acdbe09a63a670a5a5ad6bd0a2e2d8a90b9.zip | |
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`.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 8 | ||||
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/common/wtf8.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index ed797a7ee08..7ab5c90b0ab 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1580,11 +1580,11 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> { impl<K, V, S> FromIterator<(K, V)> for HashMap<K, V, S> where K: Eq + Hash, S: BuildHasher + Default { - fn from_iter<T: IntoIterator<Item=(K, V)>>(iterable: T) -> HashMap<K, V, S> { - let iter = iterable.into_iter(); - let lower = iter.size_hint().0; + fn from_iter<T: IntoIterator<Item=(K, V)>>(iter: T) -> HashMap<K, V, S> { + let iterator = iter.into_iter(); + let lower = iterator.size_hint().0; let mut map = HashMap::with_capacity_and_hasher(lower, Default::default()); - map.extend(iter); + map.extend(iterator); map } } diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index 84153955797..fdde1773a45 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -633,11 +633,11 @@ impl<T, S> FromIterator<T> for HashSet<T, S> where T: Eq + Hash, S: BuildHasher + Default, { - fn from_iter<I: IntoIterator<Item=T>>(iterable: I) -> HashSet<T, S> { - let iter = iterable.into_iter(); - let lower = iter.size_hint().0; + fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> HashSet<T, S> { + let iterator = iter.into_iter(); + let lower = iterator.size_hint().0; let mut set = HashSet::with_capacity_and_hasher(lower, Default::default()); - set.extend(iter); + set.extend(iterator); set } } diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index 8b79016c251..f64f835e198 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -356,8 +356,8 @@ impl FromIterator<CodePoint> for Wtf8Buf { /// This replaces surrogate code point pairs with supplementary code points, /// like concatenating ill-formed UTF-16 strings effectively would. impl Extend<CodePoint> for Wtf8Buf { - fn extend<T: IntoIterator<Item=CodePoint>>(&mut self, iterable: T) { - let iterator = iterable.into_iter(); + fn extend<T: IntoIterator<Item=CodePoint>>(&mut self, iter: T) { + let iterator = iter.into_iter(); let (low, _high) = iterator.size_hint(); // Lower bound of one byte per code point (ASCII only) self.bytes.reserve(low); |
