Files
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
..
2024-07-29 08:26:52 +10:00
2024-11-27 12:10:21 +00:00
2024-11-27 12:10:21 +00:00
2024-08-09 20:06:26 -04:00
2024-07-29 08:26:52 +10:00
2024-11-27 15:14:54 +00:00
2024-11-02 20:49:24 +01:00
2024-11-27 15:14:54 +00:00
2024-07-06 14:24:20 +02:00
2024-11-27 15:14:54 +00:00
2024-11-06 18:54:50 +00:00
2024-11-17 15:23:14 +09:00
2024-11-27 15:14:54 +00:00
2024-07-29 08:26:52 +10:00