Skip to content

Commit 8a4a1c7

Browse files
committed
Cange forget to ScopeGuard::into_inner
1 parent c547736 commit 8a4a1c7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/raw/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::alloc::alloc::{handle_alloc_error, Layout};
2-
use crate::scopeguard::guard;
2+
use crate::scopeguard::{guard, ScopeGuard};
33
use crate::TryReserveError;
44
use core::iter::FusedIterator;
55
use core::marker::PhantomData;
@@ -2824,7 +2824,7 @@ impl<T: Clone, A: Allocator + Clone> Clone for RawTable<T, A> {
28242824
self_.clone_from_spec(source);
28252825

28262826
// Disarm the scope guard if cloning was successful.
2827-
mem::forget(self_);
2827+
ScopeGuard::into_inner(self_);
28282828
}
28292829
}
28302830
}

src/scopeguard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ impl<T, F> ScopeGuard<T, F>
2525
where
2626
F: FnMut(&mut T),
2727
{
28-
#[allow(dead_code)]
2928
#[inline]
3029
pub fn into_inner(guard: Self) -> T {
3130
// Cannot move out of Drop-implementing types, so

0 commit comments

Comments
 (0)