From cee58b1dc41a4231be75c1ebf6c4484f0d5d3296 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 16 May 2022 08:33:58 -0400 Subject: [PATCH] use `get` method --- src/misc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc.rs b/src/misc.rs index 5078579..751584e 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -118,7 +118,7 @@ impl<'a> SteppedVector<'a> { 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) - if self.data[possible_i] == x { + if self.data.get(possible_i) == Some(&x) { // It is valid! Some(possible_i) } else {