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)]
use itertools::Itertools;
use pyo3::prelude::*;
use pyo3::types::{PyAny, PyDateTime, PyDict, PyList, PyTuple};
use pyo3::types::{PyDateAccess, PyTimeAccess};
use pyo3::{
prelude::*,
types::{
PyAny, PyDateAccess, PyDateTime, PyDict, PyList, PyTimeAccess, PyTuple,
},
};
use chrono::offset::TimeZone;
use chrono::{Datelike, Timelike, Utc};
use chrono::{offset::TimeZone, Datelike, Timelike, Utc};
use tantivy as tv;
use crate::facet::Facet;
use crate::to_pyerr;
use crate::{facet::Facet, to_pyerr};
use pyo3::{PyMappingProtocol, PyObjectProtocol};
use std::collections::BTreeMap;
use std::fmt;
use std::{collections::BTreeMap, fmt};
use tantivy::schema::Value;
fn value_to_py(py: Python, value: &Value) -> PyResult<PyObject> {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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