Skip to content

Commit e912e57

Browse files
committed
0.1.0
1 parent 88bbbeb commit e912e57

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
keywords = ["vulkan", "neofetch", "gpu", "fetch"]
66
license = "AGPL-3.0"
77
repository = "https://github.com/float3/vkfetch-rs"
8-
version = "0.0.7"
8+
version = "0.1.0"
99
name = "vkfetch-rs"
1010
categories = ["command-line-utilities"]
1111
readme = "README.md"

src/lib.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pub mod ascii_art;
33
pub mod device;
44
pub mod vendor;
55

6-
use ascii_art::RED;
76
use ash::*;
87
use device::PhysicalDevice;
98
use std::str;
@@ -40,18 +39,25 @@ const ALIGNMENT: &str = " ";
4039
fn get_device_info(device: PhysicalDevice, color: &str) -> Vec<String> {
4140
let mut output: Vec<String> = Vec::new();
4241

43-
output.push(format!(
44-
"{}{} : {}{}",
42+
let x = format!(
43+
"{}{}{}{}: {}",
4544
BOLD,
45+
color,
4646
device.device_name,
4747
RESET,
4848
device.device_type.name()
49-
));
49+
);
50+
51+
let length = device.device_name.len() + device.device_type.name().len() + 3;
52+
53+
output.push(x.clone());
54+
55+
let underline: String = std::iter::repeat("=").take(length).collect();
5056

51-
output.push(format!("{}========================================", color));
57+
output.push(format!("{}{}{}", BOLD, color, underline));
5258

5359
output.push(format!(
54-
"{}{}Device: {}0x{:X} : 0x{:X} ({})",
60+
"{}{}Device{}: 0x{:X} : 0x{:X} ({})",
5561
ALIGNMENT,
5662
color,
5763
RESET,
@@ -61,12 +67,12 @@ fn get_device_info(device: PhysicalDevice, color: &str) -> Vec<String> {
6167
));
6268

6369
output.push(format!(
64-
"{}{}Driver: {}{} : {}",
70+
"{}{}Driver{}: {} : {}",
6571
ALIGNMENT, color, RESET, device.driver_name, device.driver_info
6672
));
6773

6874
output.push(format!(
69-
"{}{}API: {}{}",
75+
"{}{}API{}: {}",
7076
ALIGNMENT, color, RESET, device.api_version,
7177
));
7278

0 commit comments

Comments
 (0)