use get method

This commit is contained in:
Simon Gardling 2022-05-16 08:33:58 -04:00
parent 0ea2661ccb
commit cee58b1dc4

View File

@ -118,7 +118,7 @@ impl<'a> SteppedVector<'a> {
let possible_i = ((x - min).abs() / self.step) as usize; let possible_i = ((x - min).abs() / self.step) as usize;
// Make sure that the index is valid by checking the data returned vs the actual data (just in case) // Make sure that the index is valid by checking the data returned vs the actual data (just in case)
if self.data[possible_i] == x { if self.data.get(possible_i) == Some(&x) {
// It is valid! // It is valid!
Some(possible_i) Some(possible_i)
} else { } else {