From d394978da77819a1b6d69231377490eede1f4b9d Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 22 Aug 2024 10:30:57 +0300 Subject: [PATCH] rust: Swap eq for == --- crates/dekoder/src/inventory.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/dekoder/src/inventory.rs b/crates/dekoder/src/inventory.rs index fda04322b..cf6540802 100644 --- a/crates/dekoder/src/inventory.rs +++ b/crates/dekoder/src/inventory.rs @@ -27,7 +27,7 @@ impl TryFrom<&'a Yaml, Error = EKOError>> Inventory { for entry in read_dir(&self.path)? { // is header file? let entry = entry?.path(); - if !entry.extension().is_some_and(|ext| ext.eq(HEADER_EXT)) { + if !entry.extension().is_some_and(|ext| ext == HEADER_EXT) { continue; } // read @@ -54,7 +54,7 @@ impl TryFrom<&'a Yaml, Error = EKOError>> Inventory { /// Check if `k` is available (with given precision). pub fn has(&self, k: &K) -> bool { - self.keys.iter().any(|it| (it.1).eq(k)) + self.keys.iter().any(|it| it.1 == k) } /// Load `k` from disk. @@ -63,7 +63,7 @@ impl TryFrom<&'a Yaml, Error = EKOError>> Inventory { let k = self .keys .iter() - .find(|it| (it.1).eq(k)) + .find(|it| it.1 == k) .ok_or(EKOError::KeyError("because it was not found".to_owned()))?; // TODO determine if errors are available let p = self.path.join(k.0).with_extension("npz.lz4");