Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Dec 26, 2024
1 parent cd7daf9 commit a26747a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ jobs:

- uses: actions-rs/toolchain@v1
with:
toolchain: "1.66.0"
toolchain: "1.71.1"
override: true

- name: check if README matches MSRV defined here
Expand Down
6 changes: 2 additions & 4 deletions src/core/src/encodings.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::hash::{BuildHasher, BuildHasherDefault, Hash, Hasher};
use std::hash::{BuildHasher, BuildHasherDefault, Hash};
use std::str;

use nohash_hasher::BuildNoHashHasher;
Expand Down Expand Up @@ -469,9 +469,7 @@ impl Colors {

fn compute_color(idxs: &IdxTracker) -> Color {
let s = BuildHasherDefault::<twox_hash::Xxh3Hash128>::default();
let mut hasher = s.build_hasher();
idxs.0.hash(&mut hasher);
hasher.finish()
s.hash_one(&idxs.0)
}

pub fn len(&self) -> usize {
Expand Down
9 changes: 3 additions & 6 deletions src/core/src/index/revindex/disk_revindex.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::cmp::max;
use std::hash::{BuildHasher, BuildHasherDefault, Hash, Hasher};
use std::hash::{BuildHasher, BuildHasherDefault};
use std::path::Path;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, RwLock};
Expand Down Expand Up @@ -30,9 +30,7 @@ const DB_VERSION: u8 = 1;

fn compute_color(idxs: &Datasets) -> Color {
let s = BuildHasherDefault::<twox_hash::Xxh3Hash128>::default();
let mut hasher = s.build_hasher();
idxs.hash(&mut hasher);
hasher.finish()
s.hash_one(idxs)
}

#[derive(Clone)]
Expand Down Expand Up @@ -354,8 +352,7 @@ impl RevIndexOps for RevIndex {

let name = [row.name(), row.filename(), row.md5()]
.into_iter()
.skip_while(|v| v.is_empty())
.next()
.find(|v| !v.is_empty())

Check warning on line 355 in src/core/src/index/revindex/disk_revindex.rs

View check run for this annotation

Codecov / codecov/patch

src/core/src/index/revindex/disk_revindex.rs#L355

Added line #L355 was not covered by tests
.unwrap(); // guaranteed to succeed because `md5` always exists

Some((name.into(), size))
Expand Down

0 comments on commit a26747a

Please sign in to comment.