Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Queue-Definition/Rust/queue-definition-1.rust
Normal file
13
Task/Queue-Definition/Rust/queue-definition-1.rust
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use std::collections::VecDeque;
|
||||
fn main() {
|
||||
let mut stack = VecDeque::new();
|
||||
stack.push_back("Element1");
|
||||
stack.push_back("Element2");
|
||||
stack.push_back("Element3");
|
||||
|
||||
assert_eq!(Some(&"Element1"), stack.front());
|
||||
assert_eq!(Some("Element1"), stack.pop_front());
|
||||
assert_eq!(Some("Element2"), stack.pop_front());
|
||||
assert_eq!(Some("Element3"), stack.pop_front());
|
||||
assert_eq!(None, stack.pop_front());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue