diff options
| author | David Tolnay <dtolnay@gmail.com> | 2022-01-15 19:28:19 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2022-01-15 19:28:21 -0800 |
| commit | ad6408dd7a786db603c2ed323894feb7110e8dea (patch) | |
| tree | c0fd9940c237c7d187975112229474b6f101b036 | |
| parent | 65d47347ada25ddb45358ec7af07f378f60aa00d (diff) | |
| download | rust-ad6408dd7a786db603c2ed323894feb7110e8dea.tar.gz rust-ad6408dd7a786db603c2ed323894feb7110e8dea.zip | |
Tweak btree iterator wording to not use 'yield'
Yield means something else in the context of generators, which are sufficiently close to iterators that it's better to avoid the terminology collision here.
| -rw-r--r-- | library/alloc/src/collections/btree/map.rs | 5 | ||||
| -rw-r--r-- | library/alloc/src/collections/btree/set.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index b38c5848b49..885632c69a8 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -65,8 +65,9 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT; /// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined /// behavior. /// -/// Iterators yielded by functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or [`BTreeMap::keys`] -/// yield their items in order by key, and take worst-case logarithmic and amortized constant time per item yielded. +/// Iterators obtained from functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or +/// [`BTreeMap::keys`] produce their items in order by key, and take worst-case logarithmic and +/// amortized constant time per item returned. /// /// [B-Tree]: https://en.wikipedia.org/wiki/B-tree /// [`Cell`]: core::cell::Cell diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index b32f5399588..31df4e98ed7 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -27,8 +27,8 @@ use super::Recover; /// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined /// behavior. /// -/// Iterators returned by [`BTreeSet::iter`] yield their items in order, -/// and take worst-case logarithmic and amortized constant time per item yielded. +/// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case +/// logarithmic and amortized constant time per item returned. /// /// [`Ord`]: core::cmp::Ord /// [`Cell`]: core::cell::Cell |
