Cargo fmt
This commit is contained in:
@@ -16,10 +16,10 @@ extern crate rss;
|
||||
// use futures::future::*;
|
||||
use tokio_core::reactor::Core;
|
||||
|
||||
use hammond_data::FeedBuilder;
|
||||
use hammond_data::Source;
|
||||
use hammond_data::database::truncate_db;
|
||||
use hammond_data::pipeline;
|
||||
use hammond_data::FeedBuilder;
|
||||
use hammond_data::Source;
|
||||
// use hammond_data::errors::*;
|
||||
|
||||
use std::io::BufReader;
|
||||
|
||||
@@ -117,10 +117,10 @@ mod tests {
|
||||
use rss::Channel;
|
||||
use tokio_core::reactor::Core;
|
||||
|
||||
use Source;
|
||||
use database::truncate_db;
|
||||
use dbqueries;
|
||||
use utils::get_feed;
|
||||
use Source;
|
||||
|
||||
use std::fs;
|
||||
use std::io::BufReader;
|
||||
|
||||
+20
-16
@@ -1,18 +1,22 @@
|
||||
#![recursion_limit = "1024"]
|
||||
#![cfg_attr(all(test, feature = "clippy"), allow(option_unwrap_used, result_unwrap_used))]
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(blacklisted_name))]
|
||||
#![cfg_attr(feature = "clippy",
|
||||
warn(option_unwrap_used, result_unwrap_used, print_stdout,
|
||||
wrong_pub_self_convention, mut_mut, non_ascii_literal, similar_names,
|
||||
unicode_not_nfc, enum_glob_use, if_not_else, items_after_statements,
|
||||
used_underscore_binding))]
|
||||
#![cfg_attr(
|
||||
feature = "clippy",
|
||||
warn(
|
||||
option_unwrap_used, result_unwrap_used, print_stdout, wrong_pub_self_convention, mut_mut,
|
||||
non_ascii_literal, similar_names, unicode_not_nfc, enum_glob_use, if_not_else,
|
||||
items_after_statements, used_underscore_binding
|
||||
)
|
||||
)]
|
||||
#![allow(unknown_lints)]
|
||||
#![deny(bad_style, const_err, dead_code, improper_ctypes, legacy_directory_ownership,
|
||||
non_shorthand_field_patterns, no_mangle_generic_items, overflowing_literals,
|
||||
path_statements, patterns_in_fns_without_body, plugin_as_library, private_in_public,
|
||||
private_no_mangle_fns, private_no_mangle_statics, safe_extern_statics,
|
||||
unconditional_recursion, unions_with_drop_fields, unused_allocation, unused_comparisons,
|
||||
unused_parens, while_true)]
|
||||
#![deny(
|
||||
bad_style, const_err, dead_code, improper_ctypes, legacy_directory_ownership,
|
||||
non_shorthand_field_patterns, no_mangle_generic_items, overflowing_literals, path_statements,
|
||||
patterns_in_fns_without_body, plugin_as_library, private_in_public, private_no_mangle_fns,
|
||||
private_no_mangle_statics, safe_extern_statics, unconditional_recursion,
|
||||
unions_with_drop_fields, unused_allocation, unused_comparisons, unused_parens, while_true
|
||||
)]
|
||||
#![deny(missing_debug_implementations, missing_docs, trivial_casts, trivial_numeric_casts)]
|
||||
#![deny(unused_extern_crates, unused)]
|
||||
|
||||
@@ -54,21 +58,21 @@ extern crate tokio_core;
|
||||
extern crate url;
|
||||
extern crate xdg;
|
||||
|
||||
pub mod database;
|
||||
#[allow(missing_docs)]
|
||||
pub mod dbqueries;
|
||||
#[allow(missing_docs)]
|
||||
pub mod errors;
|
||||
pub mod utils;
|
||||
pub mod database;
|
||||
pub mod pipeline;
|
||||
pub(crate) mod models;
|
||||
mod feed;
|
||||
pub(crate) mod models;
|
||||
mod parser;
|
||||
pub mod pipeline;
|
||||
mod schema;
|
||||
pub mod utils;
|
||||
|
||||
pub use feed::{Feed, FeedBuilder};
|
||||
pub use models::{Episode, EpisodeWidgetQuery, Podcast, PodcastCoverQuery, Source};
|
||||
pub use models::Save;
|
||||
pub use models::{Episode, EpisodeWidgetQuery, Podcast, PodcastCoverQuery, Source};
|
||||
|
||||
/// [XDG Base Direcotory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) Paths.
|
||||
#[allow(missing_debug_implementations)]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use chrono::prelude::*;
|
||||
use diesel;
|
||||
use diesel::SaveChangesDsl;
|
||||
use diesel::prelude::*;
|
||||
use diesel::SaveChangesDsl;
|
||||
|
||||
use database::connection;
|
||||
use errors::DataError;
|
||||
|
||||
@@ -287,8 +287,8 @@ impl NewEpisodeMinimal {
|
||||
mod tests {
|
||||
use database::truncate_db;
|
||||
use dbqueries;
|
||||
use models::*;
|
||||
use models::new_episode::{NewEpisodeMinimal, NewEpisodeMinimalBuilder};
|
||||
use models::*;
|
||||
|
||||
use rss::Channel;
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ use diesel::prelude::*;
|
||||
use rss;
|
||||
|
||||
use errors::DataError;
|
||||
use models::{Index, Insert, Update};
|
||||
use models::Podcast;
|
||||
use models::{Index, Insert, Update};
|
||||
use schema::podcast;
|
||||
|
||||
use database::connection;
|
||||
|
||||
@@ -3,10 +3,10 @@ use diesel::SaveChangesDsl;
|
||||
use rss::Channel;
|
||||
use url::Url;
|
||||
|
||||
use hyper::{Client, Method, Request, Response, StatusCode, Uri};
|
||||
use hyper::client::HttpConnector;
|
||||
use hyper::header::{ETag, EntityTag, HttpDate, IfModifiedSince, IfNoneMatch, LastModified,
|
||||
Location, UserAgent};
|
||||
use hyper::{Client, Method, Request, Response, StatusCode, Uri};
|
||||
use hyper_tls::HttpsConnector;
|
||||
|
||||
// use futures::future::ok;
|
||||
@@ -213,9 +213,11 @@ impl Source {
|
||||
|
||||
if !ignore_etags {
|
||||
if let Some(foo) = self.http_etag() {
|
||||
req.headers_mut().set(IfNoneMatch::Items(vec![
|
||||
EntityTag::new(true, foo.to_owned()),
|
||||
]));
|
||||
req.headers_mut()
|
||||
.set(IfNoneMatch::Items(vec![EntityTag::new(
|
||||
true,
|
||||
foo.to_owned(),
|
||||
)]));
|
||||
}
|
||||
|
||||
if let Some(foo) = self.last_modified() {
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
use futures::future::*;
|
||||
// use futures::prelude::*;
|
||||
|
||||
use hyper::Client;
|
||||
use hyper::client::HttpConnector;
|
||||
use hyper::Client;
|
||||
use hyper_tls::HttpsConnector;
|
||||
use tokio_core::reactor::Core;
|
||||
|
||||
use num_cpus;
|
||||
use rss;
|
||||
|
||||
use Source;
|
||||
use dbqueries;
|
||||
use errors::DataError;
|
||||
use models::{IndexState, NewEpisode, NewEpisodeMinimal};
|
||||
use Source;
|
||||
|
||||
// use std::sync::{Arc, Mutex};
|
||||
|
||||
@@ -141,8 +141,8 @@ where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use Source;
|
||||
use database::truncate_db;
|
||||
use Source;
|
||||
|
||||
// (path, url) tuples.
|
||||
const URLS: &[(&str, &str)] = {
|
||||
|
||||
Reference in New Issue
Block a user