diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2024-04-20 14:28:05 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2024-04-20 14:38:17 +0200 |
commit | e9bf0fc40c0eb7e9d4228b804d62f31b0a136528 (patch) | |
tree | 7872f587782d5635eadbf82ae861d474d4da2efe /crates/runner/src/util/stack.rs | |
parent | 35e68444dd5e9d3d5fc39409c48be6eb3fa05e07 (diff) | |
download | rebel-e9bf0fc40c0eb7e9d4228b804d62f31b0a136528.tar rebel-e9bf0fc40c0eb7e9d4228b804d62f31b0a136528.zip |
Rename directories to match crate names
Diffstat (limited to 'crates/runner/src/util/stack.rs')
-rw-r--r-- | crates/runner/src/util/stack.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/crates/runner/src/util/stack.rs b/crates/runner/src/util/stack.rs deleted file mode 100644 index 15d5daf..0000000 --- a/crates/runner/src/util/stack.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::mem; - -/// Simple inefficient datastructure with guaranteed drop order -#[derive(Debug)] -pub enum Stack<T> { - Cons(Box<(T, Stack<T>)>), - Empty, -} - -impl<T> Default for Stack<T> { - fn default() -> Self { - Self::Empty - } -} - -impl<T> Stack<T> { - pub fn new() -> Self { - Self::Empty - } - - pub fn push(&mut self, value: T) { - let tmp = mem::take(self); - *self = Stack::Cons(Box::new((value, tmp))); - } -} |