1
Fork 0

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.
This commit is contained in:
David Tolnay 2022-01-15 19:28:19 -08:00
parent 65d47347ad
commit ad6408dd7a
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
2 changed files with 5 additions and 4 deletions

View file

@ -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 /// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
/// behavior. /// behavior.
/// ///
/// Iterators yielded by functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or [`BTreeMap::keys`] /// Iterators obtained from functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or
/// yield their items in order by key, and take worst-case logarithmic and amortized constant time per item yielded. /// [`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 /// [B-Tree]: https://en.wikipedia.org/wiki/B-tree
/// [`Cell`]: core::cell::Cell /// [`Cell`]: core::cell::Cell

View file

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