diff --git a/src/core/src/from.rs b/src/core/src/from.rs index dbeeb58a2f..347d90afc5 100644 --- a/src/core/src/from.rs +++ b/src/core/src/from.rs @@ -16,7 +16,7 @@ impl From for KmerMinHash { let mut new_mh = KmerMinHash::new( 0, - values.get(0).unwrap().kmer.len() as u32, + values.first().unwrap().kmer.len() as u32, HashFunctions::Murmur64Dna, 42, true, diff --git a/src/core/src/index/revindex/disk_revindex.rs b/src/core/src/index/revindex/disk_revindex.rs index 3b4434824e..30c0252f6d 100644 --- a/src/core/src/index/revindex/disk_revindex.rs +++ b/src/core/src/index/revindex/disk_revindex.rs @@ -364,7 +364,7 @@ impl RevIndexOps for RevIndex { orig_query: &KmerMinHash, selection: Option, ) -> Result> { - let mut match_size = usize::max_value(); + let mut match_size = usize::MAX; let mut matches = vec![]; let mut query = KmerMinHashBTree::from(orig_query.clone()); let mut sum_weighted_found = 0; @@ -554,8 +554,7 @@ impl RevIndexOps for RevIndex { // Using unchecked version because we just used the manifest // above to make sure the storage is still consistent unsafe { - Arc::get_mut(&mut self.collection) - .map(|v| v.set_storage_unchecked(InnerStorage::new(new_storage))); + if let Some(v) = Arc::get_mut(&mut self.collection) { v.set_storage_unchecked(InnerStorage::new(new_storage)) } } // write storage spec diff --git a/src/core/src/index/revindex/mem_revindex.rs b/src/core/src/index/revindex/mem_revindex.rs index 20f4c3aabd..64580d6ac2 100644 --- a/src/core/src/index/revindex/mem_revindex.rs +++ b/src/core/src/index/revindex/mem_revindex.rs @@ -204,7 +204,7 @@ impl RevIndex { threshold: usize, query: &KmerMinHash, ) -> Result> { - let mut match_size = usize::max_value(); + let mut match_size = usize::MAX; let mut matches = vec![]; while match_size > threshold && !counter.is_empty() { diff --git a/src/core/src/storage/rocksdb.rs b/src/core/src/storage/rocksdb.rs index 0bf540aaf1..52b082af18 100644 --- a/src/core/src/storage/rocksdb.rs +++ b/src/core/src/storage/rocksdb.rs @@ -47,7 +47,7 @@ impl Storage for RocksDBStorage { fn save(&self, path: &str, content: &[u8]) -> Result { let cf_storage = self.db.cf_handle(STORAGE).unwrap(); // TODO(lirber): deal with conflict for path? - self.db.put_cf(&cf_storage, path.as_bytes(), &content[..])?; + self.db.put_cf(&cf_storage, path.as_bytes(), content)?; Ok(path.into()) }