I'm having trouble understanding the need to borrow a static vector, such as in the following code:
for t in &[Module::Diagnosis, Module::Laboratory, Module::Samples, Module::Molecules] {
if *t != self.players[0].target {
turns.push(Turn::goto(*t));
}
}
Why do I need to do &[...]
as opposed to just [...]
? In this case the Module
enum implements Copy
, so I was assuming it would just take a copy of the values.