mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add allocator function
This commit is contained in:
parent
7a9f282528
commit
208da513cc
@ -1245,6 +1245,13 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
|
||||
self.into()
|
||||
}
|
||||
|
||||
/// Returns a reference to the underlying allocator.
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
#[inline]
|
||||
pub fn allocator(&self) -> &A {
|
||||
self.data.allocator()
|
||||
}
|
||||
|
||||
/// Returns the length of the binary heap.
|
||||
///
|
||||
/// # Examples
|
||||
|
Loading…
Reference in New Issue
Block a user