mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-10-03 20:23:27 +00:00
refactor: return write error
This commit is contained in:
parent
0233cdc0fc
commit
b814b2bacf
1 changed files with 3 additions and 5 deletions
|
@ -27,7 +27,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
storage: get_root_disk_usage()?,
|
storage: get_root_disk_usage()?,
|
||||||
colors: print_dots(),
|
colors: print_dots(),
|
||||||
};
|
};
|
||||||
print_system_info(&fields);
|
print_system_info(&fields)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -49,7 +49,7 @@ struct Fields {
|
||||||
colors: String,
|
colors: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_system_info(fields: &Fields) {
|
fn print_system_info(fields: &Fields) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
use crate::colors::COLORS;
|
use crate::colors::COLORS;
|
||||||
|
|
||||||
let Fields {
|
let Fields {
|
||||||
|
@ -78,7 +78,5 @@ fn print_system_info(fields: &Fields) {
|
||||||
{blue} ▝ {cyan}▟█▜█▖{blue}▀▀▀▀▀██▛▀▀▘ {cyan} {blue}Storage (/){reset} {storage}
|
{blue} ▝ {cyan}▟█▜█▖{blue}▀▀▀▀▀██▛▀▀▘ {cyan} {blue}Storage (/){reset} {storage}
|
||||||
{cyan} ▟█▘ ▜█▖ {blue}▝█▛ {cyan} {blue}Colors{reset} {colors}\n");
|
{cyan} ▟█▘ ▜█▖ {blue}▝█▛ {cyan} {blue}Colors{reset} {colors}\n");
|
||||||
|
|
||||||
stdout()
|
Ok(stdout().write_all(system_info.as_bytes())?)
|
||||||
.write_all(system_info.as_bytes())
|
|
||||||
.expect("Failed to write to stdout");
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue