From a9406a49c67a35758eb718a16c47114a3c47b169 Mon Sep 17 00:00:00 2001 From: figsoda Date: Sat, 1 Jul 2023 16:44:29 -0400 Subject: [PATCH] update rustfmt.toml --- build.rs | 8 ++++---- rustfmt.toml | 2 +- src/cli.rs | 4 ++-- src/config.rs | 4 ++-- src/main.rs | 26 +++++++++++++------------- src/mpd.rs | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build.rs b/build.rs index 1b721c2..ee491b4 100644 --- a/build.rs +++ b/build.rs @@ -1,13 +1,13 @@ -use clap::{CommandFactory, ValueEnum}; -use clap_complete::{generate_to, Shell}; -use clap_mangen::Man; - use std::{ env, fs::{create_dir_all, File}, path::Path, }; +use clap::{CommandFactory, ValueEnum}; +use clap_complete::{generate_to, Shell}; +use clap_mangen::Man; + include!("src/cli.rs"); fn main() { diff --git a/rustfmt.toml b/rustfmt.toml index 1c2edfb..ff07045 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -2,11 +2,11 @@ unstable_features = true condense_wildcard_suffixes = true format_code_in_doc_comments = true +group_imports = "StdExternalCrate" imports_granularity = "Crate" newline_style = "Unix" normalize_comments = true normalize_doc_attributes = true -overflow_delimited_expr = false reorder_impl_items = true spaces_around_ranges = true use_field_init_shorthand = true diff --git a/src/cli.rs b/src/cli.rs index 912df7d..15b9491 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,7 @@ -use clap::Parser; - use std::path::PathBuf; +use clap::Parser; + /// Minimal mpd terminal client that aims to be simple yet highly configurable /// https://github.com/figsoda/mmtc #[derive(Parser)] diff --git a/src/config.rs b/src/config.rs index 3a0b4d3..a0f9050 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,11 +1,11 @@ +use std::fmt::{self, Formatter}; + use ratatui::style::Color; use serde::{ de::{self, EnumAccess, SeqAccess, VariantAccess, Visitor}, Deserialize, Deserializer, }; -use std::fmt::{self, Formatter}; - use crate::defaults; #[derive(Deserialize)] diff --git a/src/main.rs b/src/main.rs index 83def6b..5667c74 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,19 @@ mod defaults; mod layout; mod mpd; +use std::{ + cmp::min, + env, fs, + io::stdout, + process::exit, + sync::{ + atomic::{AtomicU8, Ordering}, + Arc, + }, + thread::{self, Thread}, + time::Duration, +}; + use anyhow::{Context, Result}; use async_io::{block_on, Timer}; use async_net::resolve; @@ -25,19 +38,6 @@ use futures_lite::StreamExt; use ratatui::{backend::CrosstermBackend, widgets::ListState, Terminal}; use secular::lower_lay_string; -use std::{ - cmp::min, - env, fs, - io::stdout, - process::exit, - sync::{ - atomic::{AtomicU8, Ordering}, - Arc, - }, - thread::{self, Thread}, - time::Duration, -}; - use crate::{ app::{Command, State}, cli::Opts, diff --git a/src/mpd.rs b/src/mpd.rs index ff7b98f..21e977e 100644 --- a/src/mpd.rs +++ b/src/mpd.rs @@ -1,3 +1,5 @@ +use std::io::{stdout, Write}; + use anyhow::{bail, Context, Result}; use async_net::{AsyncToSocketAddrs, TcpStream}; use expand::expand; @@ -7,8 +9,6 @@ use futures_lite::{ }; use secular::lower_lay_string; -use std::io::{stdout, Write}; - use crate::config::SearchFields; pub struct Client {