Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Aug 19, 2024
1 parent fbe851c commit eeeee67
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/src/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl From<MashSketcher> 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,
Expand Down
5 changes: 2 additions & 3 deletions src/core/src/index/revindex/disk_revindex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl RevIndexOps for RevIndex {
orig_query: &KmerMinHash,
selection: Option<Selection>,
) -> Result<Vec<GatherResult>> {
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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/index/revindex/mem_revindex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl RevIndex {
threshold: usize,
query: &KmerMinHash,
) -> Result<Vec<GatherResult>> {
let mut match_size = usize::max_value();
let mut match_size = usize::MAX;
let mut matches = vec![];

while match_size > threshold && !counter.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/storage/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Storage for RocksDBStorage {
fn save(&self, path: &str, content: &[u8]) -> Result<String> {
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())
}

Expand Down

0 comments on commit eeeee67

Please sign in to comment.