mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-24 09:04:19 +02:00
Implement Default for ColorOptions
This commit is contained in:
parent
5ad7dcfa34
commit
6d77483ad5
3 changed files with 8 additions and 2 deletions
|
|
@ -85,7 +85,7 @@ impl Default for RawStyle {
|
|||
italic: false,
|
||||
}
|
||||
}
|
||||
} // impl RawStyle
|
||||
}
|
||||
|
||||
impl From<RawStyle> for Style {
|
||||
fn from(raw_style: RawStyle) -> Self {
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ fn main() {
|
|||
#[cfg(not(target_os = "windows"))]
|
||||
let ansi_support = true;
|
||||
|
||||
let enable_styles = match args.color.unwrap_or(ColorOptions::Auto) {
|
||||
let enable_styles = match args.color.unwrap_or_default() {
|
||||
// Attempt to use styling if instructed
|
||||
ColorOptions::Always => true,
|
||||
// Enable styling if:
|
||||
|
|
|
|||
|
|
@ -66,6 +66,12 @@ impl str::FromStr for ColorOptions {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for ColorOptions {
|
||||
fn default() -> Self {
|
||||
Self::Auto
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum LineType {
|
||||
Empty,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue