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 chrono::{DateTime, NaiveDate, TimeZone};
use chrono_tz::Europe::Brussels;
use chrono_tz::Tz;
use rocket::http::RawStr;
use rocket::request::FromFormValue;
use serde::ser::Serializer;
use serde::Serialize;
use chrono_tz::{Europe::Brussels, Tz};
use rocket::{http::RawStr, request::FromFormValue};
use serde::{ser::Serializer, Serialize};
use std::convert::TryFrom;
/// This class is a simple wrapper around chrono's DateTime. Its sole purpose

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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