rust/library/alloc
许杰友 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
..
benches update cfgs 2024-11-27 15:14:54 +00:00
src Rollup merge of #133548 - cuviper:btreeset-entry-api, r=Mark-Simulacrum 2024-11-30 12:57:35 +08:00
tests update cfgs 2024-11-27 15:14:54 +00:00
Cargo.toml Update compiler_builtins to 0.1.138 and pin it 2024-11-03 17:43:16 -06:00