Use a VecDequeue instead of a vec for bytes (#2246)

* Fix: add both the rAF queue and vecdequeue

* Fix: Take before recycle
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-04-04 16:29:28 -07:00
1 parent 633e2a70a4
commit 0a3291084f
5 files changed
+26 -9

No files matched your search

+2 -1
View File
@@ -201,8 +201,9 @@ impl<T, S: Storage<T>> GenerationalBox<T, S> {
/// Drop the value out of the generational box and invalidate the generational box. This will return the value if the value was taken.
pub fn manually_drop(&self) -> Option<T> {
if self.validate() {
let o = Storage::take(&self.raw.0.data);
<S as AnyStorage>::recycle(&self.raw);
Storage::take(&self.raw.0.data)
o
} else {
None
}