Add #[inline] to BTreeMap::new constructor

This commit is contained in:
Urgau 2024-03-06 19:14:03 +01:00
parent 1547c076bf
commit cc38c1e9cb

View File

@ -624,6 +624,7 @@ impl<K, V> BTreeMap<K, V> {
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_btree_new", since = "1.66.0")] #[rustc_const_stable(feature = "const_btree_new", since = "1.66.0")]
#[inline]
#[must_use] #[must_use]
pub const fn new() -> BTreeMap<K, V> { pub const fn new() -> BTreeMap<K, V> {
BTreeMap { root: None, length: 0, alloc: ManuallyDrop::new(Global), _marker: PhantomData } BTreeMap { root: None, length: 0, alloc: ManuallyDrop::new(Global), _marker: PhantomData }