rust_twostack 0.15.0

Support for two-dimentional stacks for the Rust programming language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::stack::Stack;

impl<T> Stack<T> {
    pub fn left(&mut self) -> &mut Stack<T> {
        if ! self.stack.is_empty() {
            self.stack.rotate_left(1);
        }
        self
    }
    pub fn right(&mut self) -> &mut Stack<T> {
        if ! self.stack.is_empty() {
            self.stack.rotate_right(1);
        }
        self
    }
}