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:
parent
b6d4e09c7f
commit
f3813230c5
2 changed files with 6 additions and 3 deletions
|
@ -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}")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
)?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue