Cargo fmt

This commit is contained in:
Jordan Petridis
2018-04-13 04:35:50 +03:00
parent f94ccb9947
commit 87421ce74d
25 changed files with 80 additions and 77 deletions
+3 -3
View File
@@ -3,14 +3,14 @@
use gio::{ApplicationExt, ApplicationExtManual, ApplicationFlags, Settings, SettingsExt};
use glib;
use gtk;
use gtk::SettingsExt as GtkSettingsExt;
use gtk::prelude::*;
use gtk::SettingsExt as GtkSettingsExt;
use failure::Error;
use rayon;
use hammond_data::{Podcast, Source};
use hammond_data::utils::delete_show;
use hammond_data::{Podcast, Source};
use appnotif::*;
use headerbar::Header;
@@ -19,8 +19,8 @@ use stacks::Content;
use utils;
use widgets::mark_all_watched;
use std::sync::Arc;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::Arc;
use std::time::Duration;
#[derive(Clone, Debug)]
+1 -5
View File
@@ -32,11 +32,7 @@ impl Default for InAppNotification {
}
impl InAppNotification {
pub fn new<F, U>(
text: String,
mut callback: F,
undo_callback: U,
) -> Self
pub fn new<F, U>(text: String, mut callback: F, undo_callback: U) -> Self
where
F: FnMut() -> glib::Continue + 'static,
U: Fn() + 'static,
+1 -1
View File
@@ -5,8 +5,8 @@ use failure::Error;
use failure::ResultExt;
use url::Url;
use hammond_data::Source;
use hammond_data::dbqueries;
use hammond_data::Source;
use std::sync::mpsc::Sender;
+12 -9
View File
@@ -1,6 +1,9 @@
#![cfg_attr(feature = "cargo-clippy",
allow(clone_on_ref_ptr, needless_pass_by_value, useless_format, blacklisted_name,
match_same_arms))]
#![cfg_attr(
feature = "cargo-clippy",
allow(
clone_on_ref_ptr, needless_pass_by_value, useless_format, blacklisted_name, match_same_arms
)
)]
#![allow(unknown_lints)]
#![deny(unused_extern_crates, unused)]
@@ -64,18 +67,18 @@ macro_rules! clone {
// They do not need to be public
// But it helps when looking at the generated docs.
pub mod stacks;
pub mod views;
pub mod widgets;
pub mod stacks;
pub mod headerbar;
pub mod app;
pub mod headerbar;
pub mod settings;
pub mod utils;
pub mod manager;
pub mod static_resource;
pub mod appnotif;
pub mod manager;
pub mod settings;
pub mod static_resource;
pub mod utils;
use app::App;
+3 -3
View File
@@ -8,8 +8,8 @@ use hammond_downloader::downloader::{get_episode, DownloadProgress};
use app::Action;
use std::collections::HashMap;
use std::sync::{Arc, Mutex, RwLock};
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex, RwLock};
// use std::sync::atomic::AtomicUsize;
// use std::path::PathBuf;
@@ -122,17 +122,17 @@ pub fn add(id: i32, directory: String, sender: Sender<Action>) -> Result<(), Err
mod tests {
use super::*;
use hammond_data::{Episode, Source};
use hammond_data::dbqueries;
use hammond_data::pipeline;
use hammond_data::utils::get_download_folder;
use hammond_data::{Episode, Source};
use hammond_downloader::downloader::get_episode;
use std::{thread, time};
use std::fs;
use std::path::Path;
use std::sync::mpsc::channel;
use std::{thread, time};
#[test]
// This test inserts an rss feed to your `XDG_DATA/hammond/hammond.db` so we make it explicit
+1 -1
View File
@@ -7,8 +7,8 @@ use app::Action;
use stacks::EpisodeStack;
use stacks::ShowStack;
use std::sync::Arc;
use std::sync::mpsc::Sender;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct Content {
+1 -1
View File
@@ -1,6 +1,6 @@
use gtk;
use gtk::Cast;
use gtk::prelude::*;
use gtk::Cast;
use failure::Error;
+3 -3
View File
@@ -1,19 +1,19 @@
use gtk;
use gtk::Cast;
use gtk::prelude::*;
use gtk::Cast;
use failure::Error;
use hammond_data::Podcast;
use hammond_data::dbqueries;
use hammond_data::Podcast;
use views::{EmptyView, ShowsPopulated};
use app::Action;
use widgets::ShowWidget;
use std::sync::Arc;
use std::sync::mpsc::Sender;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct ShowStack {
+5 -5
View File
@@ -4,8 +4,8 @@ use gdk_pixbuf::Pixbuf;
use gio::{Settings, SettingsExt};
use glib;
use gtk;
use gtk::{IsA, Widget};
use gtk::prelude::*;
use gtk::{IsA, Widget};
use failure::Error;
use rayon;
@@ -15,21 +15,21 @@ use send_cell::SendCell;
use serde_json::Value;
// use hammond_data::feed;
use hammond_data::{PodcastCoverQuery, Source};
use hammond_data::dbqueries;
use hammond_data::pipeline;
use hammond_data::utils::checkup;
use hammond_data::{PodcastCoverQuery, Source};
use hammond_downloader::downloader;
use std::collections::{HashMap, HashSet};
use std::sync::{Mutex, RwLock};
use std::sync::Arc;
use std::sync::mpsc::*;
use std::sync::Arc;
use std::sync::{Mutex, RwLock};
use app::Action;
use chrono::Duration;
use chrono::prelude::*;
use chrono::Duration;
/// Lazy evaluates and loads widgets to the parent `container` widget.
///
+2 -2
View File
@@ -3,15 +3,15 @@ use failure::Error;
use gtk;
use gtk::prelude::*;
use hammond_data::EpisodeWidgetQuery;
use hammond_data::dbqueries;
use hammond_data::EpisodeWidgetQuery;
use app::Action;
use utils::{get_ignored_shows, set_image_from_path};
use widgets::EpisodeWidget;
use std::sync::Arc;
use std::sync::mpsc::Sender;
use std::sync::Arc;
#[derive(Debug, Clone)]
enum ListSplit {
+2 -2
View File
@@ -1,6 +1,6 @@
mod shows;
mod episodes;
mod empty;
mod episodes;
mod shows;
pub use self::empty::EmptyView;
pub use self::episodes::EpisodesView;
+2 -2
View File
@@ -2,14 +2,14 @@ use failure::Error;
use gtk;
use gtk::prelude::*;
use hammond_data::{Podcast, PodcastCoverQuery};
use hammond_data::dbqueries;
use hammond_data::{Podcast, PodcastCoverQuery};
use app::Action;
use utils::{get_ignored_shows, set_image_from_path};
use std::sync::Arc;
use std::sync::mpsc::Sender;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct ShowsPopulated {
+3 -3
View File
@@ -8,9 +8,9 @@ use open;
use rayon;
use take_mut;
use hammond_data::{EpisodeWidgetQuery, Podcast};
use hammond_data::dbqueries;
use hammond_data::utils::get_download_folder;
use hammond_data::{EpisodeWidgetQuery, Podcast};
use app::Action;
use manager;
@@ -21,8 +21,8 @@ use std::cell::RefCell;
use std::ops::DerefMut;
use std::path::Path;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex};
#[derive(Debug)]
pub struct EpisodeWidget {
@@ -370,8 +370,8 @@ fn total_size_helper(
// }
pub fn episodes_listbox(pd: Arc<Podcast>, sender: Sender<Action>) -> Result<gtk::ListBox, Error> {
use crossbeam_channel::TryRecvError::*;
use crossbeam_channel::bounded;
use crossbeam_channel::TryRecvError::*;
let count = dbqueries::get_pd_episodes_count(&pd)?;
+2 -2
View File
@@ -1,7 +1,7 @@
mod show;
mod episode;
mod episode_states;
mod show;
pub use self::episode::EpisodeWidget;
pub use self::show::ShowWidget;
pub use self::show::mark_all_watched;
pub use self::show::ShowWidget;
+2 -2
View File
@@ -5,15 +5,15 @@ use gtk::prelude::*;
use html2pango::markup_from_raw;
use open;
use hammond_data::Podcast;
use hammond_data::dbqueries;
use hammond_data::Podcast;
use app::Action;
use utils::set_image_from_path;
use widgets::episode::episodes_listbox;
use std::sync::Arc;
use std::sync::mpsc::Sender;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct ShowWidget {