tantivy: Fix some clippy warnings.

master
Damir Jelić 2019-08-08 13:55:19 +02:00
parent 41a6bb3109
commit 3f09fd38c8
3 changed files with 5 additions and 7 deletions

View File

@ -70,7 +70,7 @@ impl Document {
fn add_date(&mut self, field: &Field, value: &PyDateTime) {
let datetime = Utc
.ymd(
value.get_year().into(),
value.get_year(),
value.get_month().into(),
value.get_day().into(),
)
@ -78,7 +78,7 @@ impl Document {
value.get_hour().into(),
value.get_minute().into(),
value.get_second().into(),
value.get_microsecond().into(),
value.get_microsecond(),
);
self.inner.add_date(field.inner, &datetime);

View File

@ -36,7 +36,7 @@ impl QueryParser {
default_fields: Vec<&Field>,
) -> PyResult<QueryParser> {
let default_fields: Vec<tv::schema::Field> =
default_fields.iter().map(|&f| f.inner.clone()).collect();
default_fields.iter().map(|&f| f.inner).collect();
let parser =
tv::query::QueryParser::for_index(&index.inner, default_fields);

View File

@ -36,10 +36,8 @@ impl Searcher {
let ret = self.inner.search(&query.inner, &collector.inner);
match ret {
Ok(r) => {
let result: Vec<(f32, DocAddress)> = r
.iter()
.map(|(f, d)| (f.clone(), DocAddress::from(d)))
.collect();
let result: Vec<(f32, DocAddress)> =
r.iter().map(|(f, d)| (*f, DocAddress::from(d))).collect();
Ok(result)
}
Err(e) => Err(exceptions::ValueError::py_err(e.to_string())),