From b176f334c38c163a0be1f5000db89a39b4ed7f9c Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 13 Oct 2017 02:33:37 +0300 Subject: [PATCH] Rustfmt changes. --- hammond-data/src/lib.rs | 2 +- hammond-downloader/src/errors.rs | 5 ++--- hammond-gtk/src/main.rs | 23 +++++++++++------------ rustfmt.toml | 13 ++++++------- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index 6faf278..88fe6b3 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -30,8 +30,8 @@ pub mod index_feed; pub mod feedparser; pub mod errors; -use errors::*; use diesel::prelude::*; +use errors::*; use std::path::PathBuf; embed_migrations!("migrations/"); diff --git a/hammond-downloader/src/errors.rs b/hammond-downloader/src/errors.rs index 40c99e4..0f319c9 100644 --- a/hammond-downloader/src/errors.rs +++ b/hammond-downloader/src/errors.rs @@ -1,8 +1,7 @@ -use reqwest; -use rss; use diesel::result; use hammond_data; - +use reqwest; +use rss; use std::io; error_chain! { diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index e91eecb..6a919e0 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -5,15 +5,13 @@ extern crate gtk; extern crate hammond_data; use diesel::prelude::*; -use gtk::prelude::*; -use gtk::Orientation; -use gtk::IconSize; -use gtk::Type; use gtk::{CellRendererText, TreeStore, TreeView, TreeViewColumn}; - -use hammond_data::dbqueries; - +use gtk::IconSize; +use gtk::Orientation; +use gtk::Type; use gtk::prelude::*; +use gtk::prelude::*; +use hammond_data::dbqueries; // TODO: setup a img downloader, caching system, and then display them. fn create_child(name: &str) -> gtk::Box { @@ -52,12 +50,13 @@ fn create_tree_store(connection: &SqliteConnection, builder: >k::Builder) -> T podcast_model.insert_with_values( Some(&iter), None, + &[0, 1, 2, 6, 7, 8], &[ - 0, 1, 2, 6, 7, 8 - ], - &[ - &ep.id(), &ep.title().unwrap(), &ep.description().unwrap_or_default(), - &ep.uri(), &ep.local_uri().unwrap_or_default(), + &ep.id(), + &ep.title().unwrap(), + &ep.description().unwrap_or_default(), + &ep.uri(), + &ep.local_uri().unwrap_or_default(), &ep.published_date().unwrap_or_default(), ], ); diff --git a/rustfmt.toml b/rustfmt.toml index 2f0d91b..11ed820 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,10 +1,11 @@ verbose = false disable_all_formatting = false -skip_children = false +skip_children = false max_width = 100 +comment_width = 100 +wrap_comments = true error_on_line_overflow = true error_on_line_overflow_comments = true -wrap_comments = true tab_spaces = 4 fn_call_width = 60 newline_style = "Unix" @@ -16,12 +17,10 @@ reorder_extern_crates_in_group = true reorder_imports = false hard_tabs = false spaces_within_parens = false -use_try_shorthand = false write_mode = "Overwrite" merge_derives = true -array_horizontal_layout_threshold = 5 condense_wildcard_suffixes = true -# rustfmt 0.2.7 panics with format_string = true atm # format_strings = true -chain_one_line_max = 60 -chain_split_single_child = false +multiline_closure_forces_block = true +attributes_on_same_line_as_field = true +attributes_on_same_line_as_variant = true \ No newline at end of file