From 13f713b8200daf4b7d39cc2d39b11dd4e4fe928c Mon Sep 17 00:00:00 2001 From: soruh Date: Fri, 31 Jul 2026 03:39:11 +0200 Subject: [PATCH] Distinguish erased ownership bindings --- src/guard.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guard.rs b/src/guard.rs index 3191726..8f4a6ae 100644 --- a/src/guard.rs +++ b/src/guard.rs @@ -38,10 +38,10 @@ impl<'vec, T> ContentGuard<'vec, T> { /// The guard remains usable with an empty, zero-capacity vector. pub fn take(&mut self) -> Vec { let old_erased = std::mem::replace(self.erased, (self.reerase)(Vec::new())); - let old_erased = ManuallyDrop::new(old_erased); + let erased_owner = ManuallyDrop::new(old_erased); // SAFETY: The erased pointer, length, and capacity are valid for a Vec. // ManuallyDrop prevents the old TypeErasedVec from double-freeing the allocation. - unsafe { old_erased.parts.into_vec() } + unsafe { erased_owner.parts.into_vec() } } /// Calls `function` with the underlying vector and then type-erases it again.