mirror of
https://github.com/sharkdp/bat.git
synced 2025-03-15 15:18:45 +00:00
Implement trait Default for struct Config
This commit is contained in:
parent
0273848f54
commit
7208a63a49
@ -65,12 +65,18 @@ pub enum PagingMode {
|
|||||||
Never,
|
Never,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for PagingMode {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::Never
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
use inputfile::InputFile;
|
use inputfile::InputFile;
|
||||||
use line_range::LineRanges;
|
use line_range::LineRanges;
|
||||||
use style::{OutputComponents, OutputWrap};
|
use style::{OutputComponents, OutputWrap};
|
||||||
use syntax_mapping::SyntaxMapping;
|
use syntax_mapping::SyntaxMapping;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Default)]
|
||||||
pub struct Config<'a> {
|
pub struct Config<'a> {
|
||||||
/// List of files to print
|
/// List of files to print
|
||||||
pub files: Vec<InputFile<'a>>,
|
pub files: Vec<InputFile<'a>>,
|
||||||
|
@ -89,7 +89,7 @@ pub enum RangeCheckResult {
|
|||||||
AfterLastRange,
|
AfterLastRange,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Default)]
|
||||||
pub struct LineRanges {
|
pub struct LineRanges {
|
||||||
ranges: Vec<LineRange>,
|
ranges: Vec<LineRange>,
|
||||||
largest_upper_bound: usize,
|
largest_upper_bound: usize,
|
||||||
|
@ -21,6 +21,12 @@ pub enum OutputWrap {
|
|||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for OutputWrap {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl OutputComponent {
|
impl OutputComponent {
|
||||||
pub fn components(self, interactive_terminal: bool) -> &'static [OutputComponent] {
|
pub fn components(self, interactive_terminal: bool) -> &'static [OutputComponent] {
|
||||||
match self {
|
match self {
|
||||||
@ -66,7 +72,7 @@ impl FromStr for OutputComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Default)]
|
||||||
pub struct OutputComponents(pub HashSet<OutputComponent>);
|
pub struct OutputComponents(pub HashSet<OutputComponent>);
|
||||||
|
|
||||||
impl OutputComponents {
|
impl OutputComponents {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user