remove panic from SteppedVector

This commit is contained in:
Simon Gardling 2022-03-08 11:52:42 -05:00
parent c2af28466c
commit 46e8d02cd7

View File

@ -47,10 +47,9 @@ impl SteppedVector {
// Should work....
let possible_i = ((x + self.min) / self.step) as usize;
if self.data[possible_i] == x {
return Some(possible_i);
} else if (x >= self.min) && (self.max >= x) {
panic!("possible_i did not result in a possible value, but x is in range");
// Panic in case (no clue how this would happen). I may remove this check later.
Some(possible_i)
} else {
None
}
// Not really needed as the above code should handle everything
@ -62,8 +61,8 @@ impl SteppedVector {
return Some(i);
}
}
*/
None
*/
}
}