use chain.get instead of Some
This commit is contained in:
parent
0cc4c3bf92
commit
6e1e8dac11
@ -356,8 +356,7 @@ impl Board {
|
||||
for (idx, &(new_i, new_j)) in chain.into_iter().enumerate() {
|
||||
let piece = self.get(new_i, new_j)?;
|
||||
if piece == starting_color {
|
||||
// SAFETY! get_unchecked is fine here because it's an index of itself, it's fine
|
||||
return Some(unsafe { chain.get_unchecked(..idx) });
|
||||
return chain.get(..idx);
|
||||
}
|
||||
}
|
||||
None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user