Changed import scheme
continuous-integration/drone the build failed Details

pull/75/head
Jef Roosens 2021-05-13 15:42:05 +02:00
parent 237568d5e4
commit 6d95ffd372
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
8 changed files with 21 additions and 24 deletions

View File

@ -1,11 +1,8 @@
use crate::errors::FejError; use crate::errors::FejError;
use chrono::{DateTime, NaiveDate, TimeZone}; use chrono::{DateTime, NaiveDate, TimeZone};
use chrono_tz::Europe::Brussels; use chrono_tz::{Europe::Brussels, Tz};
use chrono_tz::Tz; use rocket::{http::RawStr, request::FromFormValue};
use rocket::http::RawStr; use serde::{ser::Serializer, Serialize};
use rocket::request::FromFormValue;
use serde::ser::Serializer;
use serde::Serialize;
use std::convert::TryFrom; use std::convert::TryFrom;
/// This class is a simple wrapper around chrono's DateTime. Its sole purpose /// This class is a simple wrapper around chrono's DateTime. Its sole purpose

View File

@ -1,8 +1,6 @@
use super::Street; use super::Street;
use crate::errors::FejError; use crate::{errors::FejError, schema::ivago_streets::dsl::*};
use crate::schema::ivago_streets::dsl::*; use {diesel::prelude::*, PgConnection};
use diesel::prelude::*;
use diesel::PgConnection;
pub fn search_streets(db_con: &PgConnection, search_term: &str) -> Result<Vec<Street>, FejError> { pub fn search_streets(db_con: &PgConnection, search_term: &str) -> Result<Vec<Street>, FejError> {
Ok(ivago_streets Ok(ivago_streets

View File

@ -2,8 +2,10 @@ use crate::errors::FejError;
use chrono::DateTime; use chrono::DateTime;
use chrono_tz::Tz; use chrono_tz::Tz;
use reqwest::blocking as reqwest; use reqwest::blocking as reqwest;
use std::collections::HashMap; use std::{
use std::convert::{From, TryFrom}; collections::HashMap,
convert::{From, TryFrom},
};
mod basic_date; mod basic_date;
pub mod db; pub mod db;

View File

@ -1,8 +1,7 @@
use crate::schema::ivago_streets; use crate::schema::ivago_streets;
use diesel::{Insertable, Queryable}; use diesel::{Insertable, Queryable};
use regex::Regex; use regex::Regex;
use rocket::http::RawStr; use rocket::{http::RawStr, request::FromFormValue};
use rocket::request::FromFormValue;
use serde::ser::{Serialize, SerializeStruct, Serializer}; use serde::ser::{Serialize, SerializeStruct, Serializer};
use std::convert::TryFrom; use std::convert::TryFrom;

View File

@ -1,6 +1,5 @@
use diesel::{insert_into, Connection, PgConnection, RunQueryDsl}; use diesel::{insert_into, Connection, PgConnection, RunQueryDsl};
use fej::ivago::search_streets; use fej::{ivago::search_streets, schema::ivago_streets::dsl::*};
use fej::schema::ivago_streets::dsl::*;
const ABC: &str = "abcdefghijklmnopqrstuvwxyz"; const ABC: &str = "abcdefghijklmnopqrstuvwxyz";

View File

@ -15,10 +15,11 @@ mod routes;
// Very temporary solution for CORS // Very temporary solution for CORS
// https://stackoverflow.com/questions/62412361/how-to-set-up-cors-or-options-for-rocket-rs // https://stackoverflow.com/questions/62412361/how-to-set-up-cors-or-options-for-rocket-rs
use rocket::fairing::AdHoc; use rocket::{
use rocket::fairing::{Fairing, Info, Kind}; fairing::{AdHoc, Fairing, Info, Kind},
use rocket::http::Header; http::Header,
use rocket::{Request, Response, Rocket}; Request, Response, Rocket,
};
use rocket_contrib::databases::diesel; use rocket_contrib::databases::diesel;
#[cfg(feature = "frontend")] #[cfg(feature = "frontend")]
use rocket_contrib::serve::StaticFiles; use rocket_contrib::serve::StaticFiles;

View File

@ -1,6 +1,8 @@
use crate::FejDbConn; use crate::FejDbConn;
use fej::ivago::db::search_streets; use fej::{
use fej::ivago::{get_pickup_times, BasicDate, PickupTime, Street}; db::search_streets,
ivago::{get_pickup_times, BasicDate, PickupTime, Street},
};
use rocket::http::Status; use rocket::http::Status;
use rocket_contrib::json::Json; use rocket_contrib::json::Json;

View File

@ -1,6 +1,5 @@
/// In here, any non-unit tests are placed. /// In here, any non-unit tests are placed.
use rocket::http::Status; use rocket::{http::Status, local::Client};
use rocket::local::Client;
fn rocket() -> rocket::Rocket { fn rocket() -> rocket::Rocket {
rocket::ignite().mount("/", super::routes::ivago()) rocket::ignite().mount("/", super::routes::ivago())