autocommit 2022-04-04 00:28:58 CEST
This commit is contained in:
parent
9ec1c5c995
commit
1f71290dab
21 changed files with 1217 additions and 132 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::utils::ptr_ext::MutPtrExt;
|
||||
use crate::utils::ptr_ext::{MutPtrExt, PtrExt};
|
||||
use std::cell::UnsafeCell;
|
||||
|
||||
pub struct Stack<T> {
|
||||
|
|
@ -23,4 +23,13 @@ impl<T> Stack<T> {
|
|||
pub fn pop(&self) -> Option<T> {
|
||||
unsafe { self.vec.get().deref_mut().pop() }
|
||||
}
|
||||
|
||||
pub fn to_vec(&self) -> Vec<T>
|
||||
where T: Clone,
|
||||
{
|
||||
unsafe {
|
||||
let v = self.vec.get().deref();
|
||||
(*v).clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue