Skip to content

Commit 9c4492e

Browse files
committed
use new colors conistently
1 parent 12ae599 commit 9c4492e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ pub fn fetch_device(
2828
.unwrap_or_else(|| panic!("unknown vendor: {}", properties.vendor_id));
2929
let art = vendor.get_ascii_art();
3030

31-
let device = Device::new(instance, device_handle);
32-
let info = get_device_info(&device, vendor.get_style()[0]);
31+
let info = get_device_info(
32+
&Device::new(instance, device_handle),
33+
(if is_ansi_supported() {
34+
vendor.get_alternative_style()
35+
} else {
36+
vendor.get_style()
37+
})[0],
38+
);
3339

3440
let _ = enable_virtual_terminal_processing();
3541

src/vendor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl Vendor {
9090
}
9191

9292
/// Returns a human-readable name for the vendor.
93-
pub fn name(&self) -> &'static str {
93+
pub const fn name(&self) -> &'static str {
9494
match self {
9595
Vendor::AMD => "AMD",
9696
Vendor::Apple => "Apple",
@@ -136,7 +136,7 @@ impl Vendor {
136136
}
137137
}
138138

139-
fn get_alternative_style(&self) -> [&str; LUT_SIZE] {
139+
pub const fn get_alternative_style(&self) -> [&str; LUT_SIZE] {
140140
match self {
141141
Vendor::AMD => AMD_STYLE_ALT,
142142
Vendor::Apple => APPLE_STYLE_ALT,

0 commit comments

Comments
 (0)