tantivy: Merge our imports.

master
Damir Jelić 2020-09-20 10:19:29 +02:00
parent 2b77bb4b0c
commit 7af1b68a45
7 changed files with 28 additions and 34 deletions

View File

@ -2,20 +2,20 @@
#![allow(clippy::wrong_self_convention)] #![allow(clippy::wrong_self_convention)]
use itertools::Itertools; use itertools::Itertools;
use pyo3::prelude::*; use pyo3::{
use pyo3::types::{PyAny, PyDateTime, PyDict, PyList, PyTuple}; prelude::*,
use pyo3::types::{PyDateAccess, PyTimeAccess}; types::{
PyAny, PyDateAccess, PyDateTime, PyDict, PyList, PyTimeAccess, PyTuple,
},
};
use chrono::offset::TimeZone; use chrono::{offset::TimeZone, Datelike, Timelike, Utc};
use chrono::{Datelike, Timelike, Utc};
use tantivy as tv; use tantivy as tv;
use crate::facet::Facet; use crate::{facet::Facet, to_pyerr};
use crate::to_pyerr;
use pyo3::{PyMappingProtocol, PyObjectProtocol}; use pyo3::{PyMappingProtocol, PyObjectProtocol};
use std::collections::BTreeMap; use std::{collections::BTreeMap, fmt};
use std::fmt;
use tantivy::schema::Value; use tantivy::schema::Value;
fn value_to_py(py: Python, value: &Value) -> PyResult<PyObject> { fn value_to_py(py: Python, value: &Value) -> PyResult<PyObject> {

View File

@ -1,6 +1,4 @@
use pyo3::basic::PyObjectProtocol; use pyo3::{basic::PyObjectProtocol, prelude::*, types::PyType};
use pyo3::prelude::*;
use pyo3::types::PyType;
use tantivy::schema; use tantivy::schema;
/// A Facet represent a point in a given hierarchy. /// A Facet represent a point in a given hierarchy.

View File

@ -1,17 +1,20 @@
#![allow(clippy::new_ret_no_self)] #![allow(clippy::new_ret_no_self)]
use pyo3::exceptions; use pyo3::{exceptions, prelude::*, types::PyAny};
use pyo3::prelude::*;
use pyo3::types::PyAny;
use crate::document::{extract_value, Document}; use crate::{
use crate::query::Query; document::{extract_value, Document},
use crate::schema::Schema; get_field,
use crate::searcher::Searcher; query::Query,
use crate::{get_field, to_pyerr}; schema::Schema,
searcher::Searcher,
to_pyerr,
};
use tantivy as tv; use tantivy as tv;
use tantivy::directory::MmapDirectory; use tantivy::{
use tantivy::schema::{NamedFieldDocument, Term, Value}; directory::MmapDirectory,
schema::{NamedFieldDocument, Term, Value},
};
const RELOAD_POLICY: &str = "commit"; const RELOAD_POLICY: &str = "commit";

View File

@ -1,5 +1,4 @@
use pyo3::exceptions; use pyo3::{exceptions, prelude::*};
use pyo3::prelude::*;
use tantivy as tv; use tantivy as tv;
mod document; mod document;

View File

@ -1,5 +1,4 @@
use pyo3::prelude::*; use pyo3::{prelude::*, PyObjectProtocol};
use pyo3::PyObjectProtocol;
use tantivy as tv; use tantivy as tv;
/// Tantivy's Query /// Tantivy's Query

View File

@ -1,7 +1,6 @@
#![allow(clippy::new_ret_no_self)] #![allow(clippy::new_ret_no_self)]
use pyo3::exceptions; use pyo3::{exceptions, prelude::*};
use pyo3::prelude::*;
use tantivy::schema; use tantivy::schema;

View File

@ -1,11 +1,7 @@
#![allow(clippy::new_ret_no_self)] #![allow(clippy::new_ret_no_self)]
use crate::document::Document; use crate::{document::Document, get_field, query::Query, to_pyerr};
use crate::query::Query; use pyo3::{exceptions::PyValueError, prelude::*, PyObjectProtocol};
use crate::{get_field, to_pyerr};
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use pyo3::PyObjectProtocol;
use tantivy as tv; use tantivy as tv;
use tantivy::collector::{Count, MultiCollector, TopDocs}; use tantivy::collector::{Count, MultiCollector, TopDocs};