on master help sign in
Code formatting
commit71b20893844857c11f26a92c600cadaa24cc0f3a authorsharkdp <davidpeter@web.de> dateSun 20 Sep 2020, 20:47 (6 years ago) parent57aa88a
5 files changed+14−11
src/bin/bat/clap_app.rs+3−3 src/printer.rs+1−1 src/syntax_mapping.rs+7−5 tests/integration_tests.rs+1−1 tests/no_duplicate_extensions.rs+2−1
src/bin/bat/clap_app.rs+3−3
@@ -104,9 +104,9 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
104104 .help("Specify the name to display for a file.")
105105 .long_help(
106106 "Specify the name to display for a file. Useful when piping \
107− data to bat from STDIN when bat does not otherwise know \
108− the filename. Note that the provided file name is also \
109− used for syntax detection.",
107+ data to bat from STDIN when bat does not otherwise know \
108+ the filename. Note that the provided file name is also \
109+ used for syntax detection.",
110110 ),
111111 );
112112
src/printer.rs+1−1
@@ -53,7 +53,7 @@ pub(crate) trait Printer {
5353}
5454
5555pub struct SimplePrinter<'a> {
56− config: &'a Config<'a>
56+ config: &'a Config<'a>,
5757}
5858
5959impl<'a> SimplePrinter<'a> {
src/syntax_mapping.rs+7−5
@@ -92,14 +92,16 @@ impl<'a> SyntaxMapping<'a> {
9292 "*.swap",
9393 "*.target",
9494 "*.timer",
95− ].iter() {
96− mapping
97− .insert(glob, MappingTarget::MapTo("INI"))
98− .unwrap();
95+ ]
96+ .iter()
97+ {
98+ mapping.insert(glob, MappingTarget::MapTo("INI")).unwrap();
9999 }
100100
101101 // pacman hooks
102− mapping.insert("*.hook", MappingTarget::MapTo("INI")).unwrap();
102+ mapping
103+ .insert("*.hook", MappingTarget::MapTo("INI"))
104+ .unwrap();
103105
104106 mapping
105107 }
tests/integration_tests.rs+1−1
@@ -1,5 +1,5 @@
11use assert_cmd::Command;
2−use predicates::{prelude::predicate,str::PredicateStrExt};
2+use predicates::{prelude::predicate, str::PredicateStrExt};
33use std::path::Path;
44use std::str::from_utf8;
55
tests/no_duplicate_extensions.rs+2−1
@@ -14,7 +14,8 @@ fn no_duplicate_extensions() {
1414 // The "Ruby Haml" syntax also comes with a '.sass' extension. However, we make sure
1515 // that 'sass' is mapped to the 'Sass' syntax.
1616 "sass",
17− // The '.fs' extension appears in F# and GLSL. We default to F#.
17+ // The '.fs' extension appears in F# and GLSL.
18+ // We default to F#.
1819 "fs",
1920 ];
2021