Skip to content

Commit

Permalink
Merge branch 'master' into asonix/update-owo-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc authored Jan 12, 2022
2 parents 9350c4f + 43ed8a5 commit 77da3e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#![warn(
missing_debug_implementations,
missing_docs,
missing_doc_code_examples,
rustdoc::missing_doc_code_examples,
rust_2018_idioms,
unreachable_pub,
bad_style,
Expand Down
6 changes: 3 additions & 3 deletions tests/themes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,22 @@ fn test_backwards_compatibility() {
let colored_spantrace_control =
String::from_utf8(fs::read(control_file_path).unwrap()).unwrap();

fn get_ansi<'a>(s: &'a str) -> impl Iterator<Item = AnsiSequence> + 'a {
fn get_ansi(s: &str) -> impl Iterator<Item = AnsiSequence> + '_ {
s.ansi_parse().filter_map(|x| {
if let Output::Escape(ansi) = x {
Some(ansi)
} else {
None
}
})
};
}

let colored_spantrace_ansi = get_ansi(&colored_spantrace);
let colored_spantrace_control_ansi = get_ansi(&colored_spantrace_control);

assert!(
colored_spantrace_ansi.eq(colored_spantrace_control_ansi),
format!("\x1b[0mANSI escape sequences are not identical to control!\n\nCONTROL:\n\n{}\n\n\n\n{:?}\n\nCURRENT:\n\n{}\n\n\n\n{:?}\n\n", &colored_spantrace_control, &colored_spantrace_control, &colored_spantrace, &colored_spantrace)
"\x1b[0mANSI escape sequences are not identical to control!\n\nCONTROL:\n\n{}\n\n\n\n{:?}\n\nCURRENT:\n\n{}\n\n\n\n{:?}\n\n", &colored_spantrace_control, &colored_spantrace_control, &colored_spantrace, &colored_spantrace
// `\x1b[0m` clears previous ANSI escape sequences
);
}

0 comments on commit 77da3e7

Please sign in to comment.