Skip to content

Commit

Permalink
Cange forget to ScopeGuard::into_inner
Browse files Browse the repository at this point in the history
  • Loading branch information
JustForFun88 committed Sep 1, 2023
1 parent c547736 commit 8a4a1c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/raw/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::alloc::alloc::{handle_alloc_error, Layout};
use crate::scopeguard::guard;
use crate::scopeguard::{guard, ScopeGuard};
use crate::TryReserveError;
use core::iter::FusedIterator;
use core::marker::PhantomData;
Expand Down Expand Up @@ -2824,7 +2824,7 @@ impl<T: Clone, A: Allocator + Clone> Clone for RawTable<T, A> {
self_.clone_from_spec(source);

// Disarm the scope guard if cloning was successful.
mem::forget(self_);
ScopeGuard::into_inner(self_);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/scopeguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ impl<T, F> ScopeGuard<T, F>
where
F: FnMut(&mut T),
{
#[allow(dead_code)]
#[inline]
pub fn into_inner(guard: Self) -> T {
// Cannot move out of Drop-implementing types, so
Expand Down

0 comments on commit 8a4a1c7

Please sign in to comment.