chore: Do a little clippy pass

This commit is contained in:
Clément Renault 2019-05-22 11:00:58 +02:00
parent 34ba520f44
commit 102fb506db
No known key found for this signature in database
GPG key ID: 0151CDAB43460DAE
7 changed files with 15 additions and 24 deletions

View file

@ -22,7 +22,6 @@ pub use self::{
pub trait Criterion: Send + Sync {
fn evaluate(&self, lhs: &RawDocument, rhs: &RawDocument) -> Ordering;
#[inline]
fn name(&self) -> &'static str;
#[inline]

View file

@ -12,7 +12,7 @@ impl<K: Hash + Eq> DistinctMap<K> {
pub fn new(limit: usize) -> Self {
DistinctMap {
inner: HashMap::new(),
limit: limit,
limit,
len: 0,
}
}
@ -31,7 +31,7 @@ pub struct BufferedDistinctMap<'a, K> {
impl<'a, K: Hash + Eq> BufferedDistinctMap<'a, K> {
pub fn new(internal: &'a mut DistinctMap<K>) -> BufferedDistinctMap<'a, K> {
BufferedDistinctMap {
internal: internal,
internal,
inner: HashMap::new(),
len: 0,
}

View file

@ -69,11 +69,7 @@ impl<'c, S, FI> QueryBuilder<'c, S, FI>
where F: Fn(DocumentId) -> Option<K>,
K: Hash + Eq,
{
DistinctQueryBuilder {
inner: self,
function: function,
size: size
}
DistinctQueryBuilder { inner: self, function, size }
}
pub fn add_searchable_attribute(&mut self, attribute: u16) {
@ -116,10 +112,10 @@ where S: Store,
if self.searchable_attrs.as_ref().map_or(true, |r| r.contains(&di.attribute)) {
let match_ = Match {
query_index: iv.index as u32,
distance: distance,
distance,
attribute: di.attribute,
word_index: di.word_index,
is_exact: is_exact,
is_exact,
char_index: di.char_index,
char_length: di.char_length,
};