main method
This commit is contained in:
parent
45389910ac
commit
b892e70bb5
1 changed files with 9 additions and 1 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -1,4 +1,12 @@
|
||||||
fn main() {}
|
fn main() {
|
||||||
|
let mut list = List::new();
|
||||||
|
list.push(1);
|
||||||
|
println!("push(1) : {:?}", list);
|
||||||
|
list.push(2);
|
||||||
|
println!("push(2) : {:?}", list);
|
||||||
|
println!("pop() -> {} : {:?}",list.pop().unwrap(),list);
|
||||||
|
println!("pop() -> {} : {:?}",list.pop().unwrap(),list);
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct List {
|
pub struct List {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue