Skip to content

Commit 208da51

Browse files
committed
Add allocator function
1 parent 7a9f282 commit 208da51

File tree

1 file changed

+7
-0
lines changed
  • library/alloc/src/collections/binary_heap

1 file changed

+7
-0
lines changed

library/alloc/src/collections/binary_heap/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,13 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
12451245
self.into()
12461246
}
12471247

1248+
/// Returns a reference to the underlying allocator.
1249+
#[unstable(feature = "allocator_api", issue = "32838")]
1250+
#[inline]
1251+
pub fn allocator(&self) -> &A {
1252+
self.data.allocator()
1253+
}
1254+
12481255
/// Returns the length of the binary heap.
12491256
///
12501257
/// # Examples

0 commit comments

Comments
 (0)