Skip to content

Instantly share code, notes, and snippets.

@aarroyoc
Created August 27, 2014 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarroyoc/54147f853a8a2b8c01d9 to your computer and use it in GitHub Desktop.
Save aarroyoc/54147f853a8a2b8c01d9 to your computer and use it in GitHub Desktop.
pushAndPop.rs
fn push(&mut self, value: u8) -> (){
self.stack.push(value);
}
fn pop(&mut self) -> u8{
let a: Option<u8>=self.stack.pop();
match a{
None => {
println!("Failed to pop");
0
},
Some(result) => {
result
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment