Skip to content

Commit c73c07a

Browse files
committed
Unique::get/get_mut was renamed to as_ref/as_mut
1 parent ea8548d commit c73c07a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hole.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl Hole {
105105

106106
/// Returns a reference to the next hole. Panics if this is the last hole.
107107
fn next_unwrap(&mut self) -> &mut Hole {
108-
unsafe { self.next.as_mut().unwrap().get_mut() }
108+
unsafe { self.next.as_mut().unwrap().as_mut() }
109109
}
110110
}
111111

@@ -188,7 +188,7 @@ fn allocate_first_fit(mut previous: &mut Hole, size: usize, align: usize) -> Opt
188188
loop {
189189
let allocation: Option<Allocation> = previous.next
190190
.as_mut()
191-
.and_then(|current| split_hole(unsafe { current.get() }.info(), size, align));
191+
.and_then(|current| split_hole(unsafe { current.as_ref() }.info(), size, align));
192192
match allocation {
193193
Some(allocation) => {
194194
// hole is big enough, so remove it from the list by updating the previous pointer
@@ -229,7 +229,7 @@ fn deallocate(mut hole: &mut Hole, addr: usize, mut size: usize) {
229229
"invalid deallocation (probably a double free)");
230230

231231
// get information about the next block
232-
let next_hole_info = hole.next.as_ref().map(|next| unsafe { next.get().info() });
232+
let next_hole_info = hole.next.as_ref().map(|next| unsafe { next.as_ref().info() });
233233

234234
match next_hole_info {
235235
Some(next) if hole_addr + hole.size == addr && addr + size == next.addr => {

0 commit comments

Comments
 (0)