Skip to content
Snippets Groups Projects
Commit fee4fc52 authored by Annabella Gethke's avatar Annabella Gethke
Browse files

Warnings suppressed

parent eb8f81e8
Branches main
No related tags found
No related merge requests found
use crate::Stack;
use std::mem;
// TODO Complete implementation
impl Stack for Vec<i32> {
fn init() -> Self {
......@@ -57,7 +56,7 @@ impl Stack for ListStack {
match self {
//mem:replace notwendig da liststack keinen copytrait hat und wir so nicht ownership wechseln koennen
Val(value, other) => *self = Val(i,Some(Box::new(std::mem::replace(self, Nil)))),
Val(_value, _other) => *self = Val(i,Some(Box::new(std::mem::replace(self, Nil)))),
//zeigt urspruenglich auf nil => fuege ein und mache restliste zu nil
Nil => *self = Val(i,None),
};
......@@ -67,7 +66,7 @@ impl Stack for ListStack {
fn top_val(&self) -> Option<&i32> {
match self{
Nil => None,
Val(value, other) => Some(value),
Val(value, _other) => Some(value),
}
......@@ -92,7 +91,7 @@ impl Stack for ListStack {
fn is_empty(&self) -> bool {
match self{
Nil => true,
Val(value,other) => false,
Val(_value,_other) => false,
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment