Skip to content

Commit

Permalink
Rollup merge of rust-lang#101727 - est31:stabilize_map_first_last, r=…
Browse files Browse the repository at this point in the history
…m-ou-se

Stabilize map_first_last

Stabilizes the following functions:

```Rust
impl<T> BTreeSet<T> {
    pub fn first(&self) -> Option<&T> where T: Ord;
    pub fn last(&self) -> Option<&T> where T: Ord;
    pub fn pop_first(&mut self) -> Option<T> where T: Ord;
    pub fn pop_last(&mut self) -> Option<T> where T: Ord;
}

impl<K, V> BTreeMap<K, V> {
    pub fn first_key_value(&self) -> Option<(&K, &V)> where K: Ord;
    pub fn last_key_value(&self) -> Option<(&K, &V)> where K: Ord;
    pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord;
    pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord;
    pub fn pop_first(&mut self) -> Option<(K, V)> where K: Ord;
    pub fn pop_last(&mut self) -> Option<(K, V)> where K: Ord;
}
```

Closes rust-lang#62924

~~Blocked on the [FCP](rust-lang#62924 (comment)) finishing.~~ Edit: It finished!
  • Loading branch information
matthiaskrgr authored Oct 11, 2022
2 parents 083b09f + 13cd0ce commit 34ac279
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(rustc_private)]
#![feature(map_first_last)]
#![feature(map_try_insert)]
#![feature(never_type)]
#![feature(try_blocks)]
Expand Down

0 comments on commit 34ac279

Please sign in to comment.