Skip to content

Commit 5cadac6

Browse files
committed
♻️ Use debug impl in example
1 parent 2997a2c commit 5cadac6

File tree

1 file changed

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

1 file changed

+3
-7
lines changed

crates/terminal-colorsaurus/examples/theme.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
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+
use terminal_colorsaurus::{color_palette, Error};
55

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

1410
println!(
15-
"{theme}, fg: {}, bg: {}",
11+
"{theme:?}, fg: {}, bg: {}",
1612
colors.foreground.perceived_lightness(),
1713
colors.background.perceived_lightness()
1814
);

0 commit comments

Comments
 (0)