Skip to content

Commit

Permalink
Name it, I like it
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Nov 17, 2024
1 parent 6a0329a commit 535c17e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ pub(crate) enum UnchangedStyle {
#[default]
None,

/// Try it and report back!
/// Old unchanged faint yellow, new unchanged plain yellow
Yellow,

/// Try it and report back! Same as yellow for now.
Experimental,
}

Expand Down Expand Up @@ -496,7 +499,8 @@ fn main() {

let formatter = match options.unchanged_style.unwrap_or(UnchangedStyle::None) {
UnchangedStyle::None => Formatter::default(),
UnchangedStyle::Experimental => Formatter::experimental(),
UnchangedStyle::Yellow => Formatter::yellow(),
UnchangedStyle::Experimental => Formatter::yellow(),
};

if let (Some(file1), Some(file2)) = (options.f1, options.f2) {
Expand Down
6 changes: 3 additions & 3 deletions src/refiner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Formatter {
}
}

pub(crate) fn experimental() -> Self {
pub(crate) fn yellow() -> Self {
Formatter {
line_style_old: LineStyle {
prefix_style: ANSI_STYLE_NORMAL.with_color(Red),
Expand Down Expand Up @@ -112,8 +112,8 @@ impl Formatter {
fn too_large_to_refine(texts: &[&str]) -> bool {
let size = texts.iter().map(|text| text.len()).sum::<usize>();

// This limit used to be higher, but then refining too long on Johan's
// laptop. This number is based on very limited experimentation.
// This limit used to be higher, but then refining took too long on
// Johan's laptop. This number is based on very limited experimentation.
return size > 300_000usize;
}

Expand Down

0 comments on commit 535c17e

Please sign in to comment.