on master help sign in
Auto-format Rust code
commitb3903175c8b5d72c0a9dc428d77bec01bdc349fa authorsharkdp <davidpeter@web.de> dateSun 11 Oct 2020, 21:57 (6 years ago) parentde47bd2
2 files changed+10−7
src/bin/bat/config.rs+1−2 src/output.rs+9−5
src/bin/bat/config.rs+1−2
@@ -44,8 +44,7 @@ pub fn generate_config_file() -> bat::error::Result<()> {
4444 }
4545 }
4646
47− let default_config =
48− r#"# This is `bat`s configuration file. Each line either contains a comment or
47+ let default_config = r#"# This is `bat`s configuration file. Each line either contains a comment or
4948# a command-line option that you want to pass to `bat` by default. You can
5049# run `bat --help` to get a list of all possible configuration options.
5150
src/output.rs+9−5
@@ -10,7 +10,6 @@ use crate::paging::PagingMode;
1010#[cfg(feature = "paging")]
1111use crate::wrapping::WrappingMode;
1212
13−
1413#[cfg(feature = "paging")]
1514#[derive(Debug, PartialEq)]
1615enum SingleScreenAction {
@@ -18,7 +17,6 @@ enum SingleScreenAction {
1817 Nothing,
1918}
2019
21−
2220#[derive(Debug)]
2321pub enum OutputType {
2422 #[cfg(feature = "paging")]
@@ -28,11 +26,17 @@ pub enum OutputType {
2826
2927impl OutputType {
3028 #[cfg(feature = "paging")]
31− pub fn from_mode(paging_mode: PagingMode, wrapping_mode: WrappingMode, pager: Option<&str>) -> Result<Self> {
29+ pub fn from_mode(
30+ paging_mode: PagingMode,
31+ wrapping_mode: WrappingMode,
32+ pager: Option<&str>,
33+ ) -> Result<Self> {
3234 use self::PagingMode::*;
3335 Ok(match paging_mode {
3436 Always => OutputType::try_pager(SingleScreenAction::Nothing, wrapping_mode, pager)?,
35− QuitIfOneScreen => OutputType::try_pager(SingleScreenAction::Quit, wrapping_mode, pager)?,
37+ QuitIfOneScreen => {
38+ OutputType::try_pager(SingleScreenAction::Quit, wrapping_mode, pager)?
39+ }
3640 _ => OutputType::stdout(),
3741 })
3842 }
@@ -42,7 +46,7 @@ impl OutputType {
4246 fn try_pager(
4347 single_screen_action: SingleScreenAction,
4448 wrapping_mode: WrappingMode,
45− pager_from_config: Option<&str>
49+ pager_from_config: Option<&str>,
4650 ) -> Result<Self> {
4751 use std::env;
4852 use std::ffi::OsString;