Fix Games methods to not take ownership of self
This commit is contained in:
parent
055ec379d7
commit
4d7036ade2
|
@ -23,14 +23,14 @@ impl Games {
|
||||||
.collect(),
|
.collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn valid_games(self) -> Vec<i32> {
|
fn valid_games(&self) -> Vec<i32> {
|
||||||
self.games
|
self.games
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|m| m.valid())
|
.filter(|m| m.valid())
|
||||||
.map(|m| m.id)
|
.map(|m| m.id)
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
fn valid_sum(self) -> i32 {
|
fn valid_sum(&self) -> i32 {
|
||||||
self.valid_games().iter().sum()
|
self.valid_games().iter().sum()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue