Skip to content

Commit ad6408d

Browse files
committed
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.
1 parent 65d4734 commit ad6408d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

library/alloc/src/collections/btree/map.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
6565
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
6666
/// behavior.
6767
///
68-
/// Iterators yielded by functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or [`BTreeMap::keys`]
69-
/// yield their items in order by key, and take worst-case logarithmic and amortized constant time per item yielded.
68+
/// Iterators obtained from functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or
69+
/// [`BTreeMap::keys`] produce their items in order by key, and take worst-case logarithmic and
70+
/// amortized constant time per item returned.
7071
///
7172
/// [B-Tree]: https://en.wikipedia.org/wiki/B-tree
7273
/// [`Cell`]: core::cell::Cell

library/alloc/src/collections/btree/set.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use super::Recover;
2727
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
2828
/// behavior.
2929
///
30-
/// Iterators returned by [`BTreeSet::iter`] yield their items in order,
31-
/// and take worst-case logarithmic and amortized constant time per item yielded.
30+
/// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case
31+
/// logarithmic and amortized constant time per item returned.
3232
///
3333
/// [`Ord`]: core::cmp::Ord
3434
/// [`Cell`]: core::cell::Cell

0 commit comments

Comments
 (0)