Skip to content

Commit 1d6e7d6

Browse files
committed
♻️ Use debug impl in example
1 parent 67a6cbc commit 1d6e7d6

File tree

1 file changed

+5
-7
lines changed
  • crates/terminal-colorsaurus/examples

1 file changed

+5
-7
lines changed

crates/terminal-colorsaurus/examples/theme.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
//! This example shows how to detect if the terminal uses
22
//! a dark-on-light or a light-on-dark theme.
33
4-
use terminal_colorsaurus::{color_palette, ColorScheme, Error};
4+
#![allow(clippy::use_debug)]
5+
6+
use terminal_colorsaurus::{color_palette, Error};
57

68
fn main() -> Result<(), display::DisplayAsDebug<Error>> {
79
let colors = color_palette()?;
8-
9-
let theme = match colors.color_scheme() {
10-
ColorScheme::Dark => "dark",
11-
ColorScheme::Light => "light",
12-
};
10+
let theme = colors.color_scheme();
1311

1412
println!(
15-
"{theme}, fg: {}, bg: {}",
13+
"{theme:?}, fg: {}, bg: {}",
1614
colors.foreground.perceived_lightness(),
1715
colors.background.perceived_lightness()
1816
);

0 commit comments

Comments
 (0)