diff options
| author | bors <bors@rust-lang.org> | 2021-07-08 17:51:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-08 17:51:10 +0000 |
| commit | aa65b08b1dbaf4b637847646801ebc8c01d7ecbd (patch) | |
| tree | 9828a028f1c2c73ed4f8c85959c7eebb747ecc48 /library/alloc/src | |
| parent | d0485c7986e0dac6ffd0207aba56467cb9378d85 (diff) | |
| parent | 60566820b3800036a00e2b7e5787b8c816dc2342 (diff) | |
| download | rust-aa65b08b1dbaf4b637847646801ebc8c01d7ecbd.tar.gz rust-aa65b08b1dbaf4b637847646801ebc8c01d7ecbd.zip | |
Auto merge of #86982 - GuillaumeGomez:rollup-7sbye3c, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - #84961 (Rework SESSION_GLOBALS API) - #86726 (Use diagnostic items instead of lang items for rfc2229 migrations) - #86789 (Update BTreeSet::drain_filter documentation) - #86838 (Checking that function is const if marked with rustc_const_unstable) - #86903 (Fix small headers display) - #86913 (Document rustdoc with `--document-private-items`) - #86957 (Update .mailmap file) - #86971 (mailmap: Add alternative addresses for myself) Failed merges: - #86869 (Account for capture kind in auto traits migration) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/btree/set.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index 34ec27e461c..45ea30b5386 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -940,18 +940,20 @@ impl<T> BTreeSet<T> { BTreeSet { map: self.map.split_off(key) } } - /// Creates an iterator which uses a closure to determine if a value should be removed. + /// Creates an iterator that visits all values in ascending order and uses a closure + /// to determine if a value should be removed. /// - /// If the closure returns true, then the value is removed and yielded. - /// If the closure returns false, the value will remain in the list and will not be yielded - /// by the iterator. + /// If the closure returns `true`, the value is removed from the set and yielded. If + /// the closure returns `false`, or panics, the value remains in the set and will + /// not be yielded. /// - /// If the iterator is only partially consumed or not consumed at all, each of the remaining - /// values will still be subjected to the closure and removed and dropped if it returns true. + /// If the iterator is only partially consumed or not consumed at all, each of the + /// remaining values is still subjected to the closure and removed and dropped if it + /// returns `true`. /// - /// It is unspecified how many more values will be subjected to the closure - /// if a panic occurs in the closure, or if a panic occurs while dropping a value, or if the - /// `DrainFilter` itself is leaked. + /// It is unspecified how many more values will be subjected to the closure if a + /// panic occurs in the closure, or if a panic occurs while dropping a value, or if + /// the `DrainFilter` itself is leaked. /// /// # Examples /// |
