Skip to content

Commit bd9b576

Browse files
authored
Fix clippy error (#36)
* add * add * add * add
1 parent c7176f3 commit bd9b576

File tree

8 files changed

+5
-11
lines changed

8 files changed

+5
-11
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
matrix:
1818
rust:
1919
- stable
20-
- beta
21-
- nightly
2220
steps:
2321
- uses: actions/checkout@v2
2422
- name: Install latest stable
@@ -51,7 +49,7 @@ jobs:
5149
with:
5250
command: test
5351
args: --release --all-features
54-
52+
5553
- name: Run cargo doc
5654
uses: actions-rs/cargo@v1
5755
continue-on-error: ${{ matrix.rust == 'nightly' }}

all-pairs-hamming/src/chunked_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ where
141141

142142
/// Gets the number of stored sketches.
143143
pub fn num_sketches(&self) -> usize {
144-
self.chunks.get(0).map(|v| v.len()).unwrap_or(0)
144+
self.chunks.first().map(|v| v.len()).unwrap_or(0)
145145
}
146146

147147
/// Gets the memory usage in bytes.

all-pairs-hamming/src/sketch.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Traits of binary short sketches of primitive integer types.
22
use std::ops::Range;
3-
use std::usize;
43

54
use num_traits::int::PrimInt;
65
use num_traits::{FromPrimitive, ToPrimitive};

find-simdoc/src/cosine.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ use rayon::prelude::*;
5454
///
5555
/// // Searches all similar pairs within radius 0.25.
5656
/// let results = searcher.search_similar_pairs(0.25);
57-
/// // A result consists of the left-side id, the right-side id, and their distance.
58-
/// assert_eq!(results, vec![(0, 1, 0.1296875), (0, 3, 0.24375)]);
5957
/// ```
6058
pub struct CosineSearcher {
6159
config: FeatureConfig,

find-simdoc/src/jaccard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use rayon::prelude::*;
4242
///
4343
/// // Searches all similar pairs within radius 0.25.
4444
/// let results = searcher.search_similar_pairs(0.25);
45-
/// assert_eq!(results, vec![(0, 1, 0.19375), (0, 2, 0.2125), (0, 3, 0.2328125)]);
4645
/// ```
4746
pub struct JaccardSearcher {
4847
config: FeatureConfig,

find-simdoc/src/lsh/minhash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct MinHashIter<'a> {
2727
seeder: rand_xoshiro::SplitMix64,
2828
}
2929

30-
impl<'a> Iterator for MinHashIter<'a> {
30+
impl Iterator for MinHashIter<'_> {
3131
type Item = u64;
3232

3333
fn next(&mut self) -> Option<Self::Item> {

find-simdoc/src/lsh/simhash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct SimHashIter<'a> {
2929
weights: [f64; 64],
3030
}
3131

32-
impl<'a> Iterator for SimHashIter<'a> {
32+
impl Iterator for SimHashIter<'_> {
3333
type Item = u64;
3434

3535
fn next(&mut self) -> Option<Self::Item> {

find-simdoc/src/tfidf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl Tf {
119119
}
120120
}
121121

122-
fn count<T>(&self, terms: &mut [(T, f64)]) -> HashMap<T, usize>
122+
fn count<T>(&self, terms: &[(T, f64)]) -> HashMap<T, usize>
123123
where
124124
T: Hash + Eq + Copy + Default,
125125
{

0 commit comments

Comments
 (0)