rust/library/alloc/src
许杰友 Jieyou Xu (Joe) 132fcd89b3
Rollup merge of #133548 - cuviper:btreeset-entry-api, r=Mark-Simulacrum
Add `BTreeSet` entry APIs to match `HashSet`

The following methods are added, along with the corresponding `Entry` implementation.

```rust
impl<T, A: Allocator + Clone> BTreeSet<T, A> {
    pub fn get_or_insert(&mut self, value: T) -> &T
    where
        T: Ord,
    {...}
    pub fn get_or_insert_with<Q: ?Sized, F>(&mut self, value: &Q, f: F) -> &T
    where
        T: Borrow<Q> + Ord,
        Q: Ord,
        F: FnOnce(&Q) -> T,
    {...}

    pub fn entry(&mut self, value: T) -> Entry<'_, T, A>
    where
        T: Ord,
    {...}
}
```

Tracking issue #133549
Closes https://github.com/rust-lang/rfcs/issues/1490
2024-11-30 12:57:35 +08:00
..
alloc Reformat use declarations. 2024-07-29 08:26:52 +10:00
boxed replace placeholder version 2024-11-27 12:10:21 +00:00
collections Rollup merge of #133548 - cuviper:btreeset-entry-api, r=Mark-Simulacrum 2024-11-30 12:57:35 +08:00
ffi replace placeholder version 2024-11-27 12:10:21 +00:00
raw_vec Polymorphize RawVec 2024-08-09 20:06:26 -04:00
rc Add str.as_str() for easy dereferencing of Box<str> 2024-09-19 16:25:56 +01:00
sync Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
testing Reformat use declarations. 2024-07-29 08:26:52 +10:00
vec Auto merge of #133533 - BoxyUwU:bump-boostrap, r=jieyouxu,Mark-Simulacrum 2024-11-29 22:39:10 +00:00
alloc.rs fix Allocator method names in alloc free function docs 2024-11-24 16:38:29 -08:00
borrow.rs remove const_cow_is_borrowed feature gate 2024-10-12 19:48:28 +02:00
boxed.rs update cfgs 2024-11-27 15:14:54 +00:00
fmt.rs Rustdoc: added brief colon explanation 2024-11-02 20:49:24 +01:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs update cfgs 2024-11-27 15:14:54 +00:00
macros.rs Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
raw_vec.rs Auto merge of #133533 - BoxyUwU:bump-boostrap, r=jieyouxu,Mark-Simulacrum 2024-11-29 22:39:10 +00:00
rc.rs update cfgs 2024-11-27 15:14:54 +00:00
slice.rs Port sort-research-rs test suite Rust stdlib tests 2024-09-30 15:05:30 +02:00
str.rs Inline str::repeat 2024-11-06 18:54:50 +00:00
string.rs alloc: fix String's doc 2024-11-17 15:23:14 +09:00
sync.rs update cfgs 2024-11-27 15:14:54 +00:00
task.rs split up the first paragraph of doc comments for better summaries 2024-11-10 13:22:58 -06:00
tests.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00