2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 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