1
Fork 0
mirror of https://github.com/RGBCube/watt synced 2025-07-30 09:27:45 +00:00

power_supply&cpu: kolor

This commit is contained in:
RGBCube 2025-05-19 21:47:56 +03:00
parent b6d4e09c7f
commit f3813230c5
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,5 @@
use anyhow::{Context, bail};
use yansi::Paint as _;
use std::{fmt, fs, path::Path, string::ToString};
@ -36,7 +37,8 @@ pub struct Cpu {
impl fmt::Display for Cpu {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let Self { number, .. } = self;
let number = self.number.cyan();
write!(f, "CPU {number}")
}
}

View file

@ -1,4 +1,5 @@
use anyhow::{Context, bail};
use yansi::Paint as _;
use std::{
fmt, fs,
@ -62,13 +63,13 @@ pub struct PowerSupply {
impl fmt::Display for PowerSupply {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "power supply '{name}'", name = &self.name)?;
write!(f, "power supply '{name}'", name = self.name.yellow())?;
if let Some(config) = self.threshold_config.as_ref() {
write!(
f,
" from manufacturer '{manufacturer}'",
manufacturer = config.manufacturer,
manufacturer = config.manufacturer.green(),
)?;
}