From 495fab24a57b75b0b773acb708164950221d3800 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 11 Apr 2020 19:40:04 +0200 Subject: [PATCH] cargo fmt --- Cargo.lock | 2 +- src/bin/bat/config.rs | 17 ++++++++++++++--- src/bin/bat/main.rs | 5 ++++- src/printer.rs | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f19b5a0d..2ff82722 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -490,7 +490,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/src/bin/bat/config.rs b/src/bin/bat/config.rs index 8595ad5b..0ed56bc7 100644 --- a/src/bin/bat/config.rs +++ b/src/bin/bat/config.rs @@ -17,7 +17,10 @@ pub fn config_file() -> PathBuf { pub fn generate_config_file() -> bat::errors::Result<()> { let config_file = config_file(); if config_file.exists() { - println!("A config file already exists at: {}", config_file.to_string_lossy()); + println!( + "A config file already exists at: {}", + config_file.to_string_lossy() + ); print!("Overwrite? (y/N): "); io::stdout().flush()?; @@ -31,7 +34,12 @@ pub fn generate_config_file() -> bat::errors::Result<()> { let config_dir = config_file.parent(); match config_dir { Some(path) => fs::create_dir_all(path)?, - None => return Ok(Err(format!("Unable to write config file to: {}", config_file.to_string_lossy()))?), + None => { + return Ok(Err(format!( + "Unable to write config file to: {}", + config_file.to_string_lossy() + ))?) + } } } @@ -54,7 +62,10 @@ pub fn generate_config_file() -> bat::errors::Result<()> { "#; fs::write(&config_file, default_config)?; - println!("Success! Config file written to {}", config_file.to_string_lossy()); + println!( + "Success! Config file written to {}", + config_file.to_string_lossy() + ); return Ok(()); } diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 15cc37fa..a1936a11 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -17,7 +17,10 @@ use std::process; use ansi_term::Colour::Green; use ansi_term::Style; -use crate::{app::App, config::{config_file, generate_config_file}}; +use crate::{ + app::App, + config::{config_file, generate_config_file}, +}; use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir}; use bat::Controller; use directories::PROJECT_DIRS; diff --git a/src/printer.rs b/src/printer.rs index b269219c..3fa20ac7 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -21,9 +21,9 @@ use unicode_width::UnicodeWidthChar; use crate::assets::HighlightingAssets; use crate::config::Config; -use crate::decorations::{Decoration, GridBorderDecoration, LineNumberDecoration}; #[cfg(feature = "git")] use crate::decorations::LineChangesDecoration; +use crate::decorations::{Decoration, GridBorderDecoration, LineNumberDecoration}; #[cfg(feature = "git")] use crate::diff::{get_git_diff, LineChanges}; use crate::errors::*;