Rust 2018! (#726)

This commit is contained in:
Ana Gelez
2020-01-21 07:02:03 +01:00
committed by Igor Galić
parent 3663bffe5c
commit 5f8d6b8e0e
115 changed files with 447 additions and 582 deletions
+8 -6
View File
@@ -8,15 +8,17 @@ pub use self::searcher::*;
pub(crate) mod tests {
use super::{Query, Searcher};
use diesel::Connection;
use plume_common::utils::random_hex;
use std::env::temp_dir;
use std::str::FromStr;
use blogs::tests::fill_database;
use plume_common::utils::random_hex;
use post_authors::*;
use posts::{NewPost, Post};
use safe_string::SafeString;
use tests::db;
use crate::{
blogs::tests::fill_database,
post_authors::*,
posts::{NewPost, Post},
safe_string::SafeString,
tests::db,
};
pub(crate) fn get_searcher() -> Searcher {
let dir = temp_dir().join(&format!("plume-test-{}", random_hex()));
+1 -1
View File
@@ -1,5 +1,5 @@
use crate::search::searcher::Searcher;
use chrono::{naive::NaiveDate, offset::Utc, Datelike};
use search::searcher::Searcher;
use std::{cmp, ops::Bound};
use tantivy::{query::*, schema::*, Term};
+8 -10
View File
@@ -1,9 +1,11 @@
use instance::Instance;
use posts::Post;
use schema::posts;
use tags::Tag;
use Connection;
use crate::{
instance::Instance,
posts::Post,
schema::posts,
search::{query::PlumeQuery, tokenizer},
tags::Tag,
Connection, Result,
};
use chrono::Datelike;
use diesel::{ExpressionMethods, QueryDsl, RunQueryDsl};
use itertools::Itertools;
@@ -14,10 +16,6 @@ use tantivy::{
};
use whatlang::{detect as detect_lang, Lang};
use super::tokenizer;
use search::query::PlumeQuery;
use Result;
#[derive(Debug)]
pub enum SearcherError {
IndexCreationError,