Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Stack/Rust/stack-1.rust
Normal file
12
Task/Stack/Rust/stack-1.rust
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fn main() {
|
||||
let mut stack = Vec::new();
|
||||
stack.push("Element1");
|
||||
stack.push("Element2");
|
||||
stack.push("Element3");
|
||||
|
||||
assert_eq!(Some(&"Element3"), stack.last());
|
||||
assert_eq!(Some("Element3"), stack.pop());
|
||||
assert_eq!(Some("Element2"), stack.pop());
|
||||
assert_eq!(Some("Element1"), stack.pop());
|
||||
assert_eq!(None, stack.pop());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue