Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/formatter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub mod style;

use self::style::{Style, StyleClass, Stylesheet};

#[cfg(feature = "ansi_term")]
#[cfg(feature = "color")]
use crate::stylesheets::color::AnsiTermStylesheet;
use crate::{display_list::*, stylesheets::no_color::NoColorStylesheet};

Expand All @@ -26,7 +26,7 @@ fn is_annotation_empty(annotation: &Annotation<'_>) -> bool {
.all(|fragment| fragment.content.is_empty())
}

#[cfg(feature = "ansi_term")]
#[cfg(feature = "color")]
#[inline]
pub fn get_term_style(color: bool) -> Box<dyn Stylesheet> {
if color {
Expand All @@ -36,7 +36,7 @@ pub fn get_term_style(color: bool) -> Box<dyn Stylesheet> {
}
}

#[cfg(not(feature = "ansi_term"))]
#[cfg(not(feature = "color"))]
#[inline]
pub fn get_term_style(_color: bool) -> Box<dyn Stylesheet> {
Box::new(NoColorStylesheet)
Expand Down
2 changes: 1 addition & 1 deletion src/stylesheets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
//! By default the `no_color` is available. If the crate gets compiled
//! with `ansi_term`, the `color` stylesheet is added.

#[cfg(feature = "ansi_term")]
#[cfg(feature = "color")]
pub mod color;
pub mod no_color;