From 71b20893844857c11f26a92c600cadaa24cc0f3a Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sun, 20 Sep 2020 20:47:21 +0200 Subject: [PATCH] Code formatting --- src/bin/bat/clap_app.rs | 6 +++--- src/printer.rs | 2 +- src/syntax_mapping.rs | 12 +++++++----- tests/integration_tests.rs | 2 +- tests/no_duplicate_extensions.rs | 3 ++- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs index 894c1bfb..aab61f35 100644 --- a/src/bin/bat/clap_app.rs +++ b/src/bin/bat/clap_app.rs @@ -104,9 +104,9 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .help("Specify the name to display for a file.") .long_help( "Specify the name to display for a file. Useful when piping \ - data to bat from STDIN when bat does not otherwise know \ - the filename. Note that the provided file name is also \ - used for syntax detection.", + data to bat from STDIN when bat does not otherwise know \ + the filename. Note that the provided file name is also \ + used for syntax detection.", ), ); diff --git a/src/printer.rs b/src/printer.rs index 7e369a6e..71bf78ee 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -53,7 +53,7 @@ pub(crate) trait Printer { } pub struct SimplePrinter<'a> { - config: &'a Config<'a> + config: &'a Config<'a>, } impl<'a> SimplePrinter<'a> { diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 96ce7fc6..25caf53f 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -92,14 +92,16 @@ impl<'a> SyntaxMapping<'a> { "*.swap", "*.target", "*.timer", - ].iter() { - mapping - .insert(glob, MappingTarget::MapTo("INI")) - .unwrap(); + ] + .iter() + { + mapping.insert(glob, MappingTarget::MapTo("INI")).unwrap(); } // pacman hooks - mapping.insert("*.hook", MappingTarget::MapTo("INI")).unwrap(); + mapping + .insert("*.hook", MappingTarget::MapTo("INI")) + .unwrap(); mapping } diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index a1f3538c..da0690ef 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,5 +1,5 @@ use assert_cmd::Command; -use predicates::{prelude::predicate,str::PredicateStrExt}; +use predicates::{prelude::predicate, str::PredicateStrExt}; use std::path::Path; use std::str::from_utf8; diff --git a/tests/no_duplicate_extensions.rs b/tests/no_duplicate_extensions.rs index 3f2f1460..7bfe431a 100644 --- a/tests/no_duplicate_extensions.rs +++ b/tests/no_duplicate_extensions.rs @@ -14,7 +14,8 @@ fn no_duplicate_extensions() { // The "Ruby Haml" syntax also comes with a '.sass' extension. However, we make sure // that 'sass' is mapped to the 'Sass' syntax. "sass", - // The '.fs' extension appears in F# and GLSL. We default to F#. + // The '.fs' extension appears in F# and GLSL. + // We default to F#. "fs", ];