mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-12-14 00:21:00 +00:00
get rid of formatting in release module
This commit is contained in:
parent
e812605d45
commit
73b6b7a0d0
1 changed files with 8 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
use std::{fmt::Write as _, io};
|
use std::io;
|
||||||
|
|
||||||
use crate::{UtsName, syscall::read_file_fast};
|
use crate::{UtsName, syscall::read_file_fast};
|
||||||
|
|
||||||
|
|
@ -13,7 +13,13 @@ pub fn get_system_info(utsname: &UtsName) -> String {
|
||||||
let capacity = sysname.len() + 1 + release.len() + 2 + machine.len() + 1;
|
let capacity = sysname.len() + 1 + release.len() + 2 + machine.len() + 1;
|
||||||
let mut result = String::with_capacity(capacity);
|
let mut result = String::with_capacity(capacity);
|
||||||
|
|
||||||
write!(result, "{sysname} {release} ({machine})").unwrap();
|
result.push_str(sysname);
|
||||||
|
result.push(' ');
|
||||||
|
result.push_str(release);
|
||||||
|
result.push(' ');
|
||||||
|
result.push('(');
|
||||||
|
result.push_str(machine);
|
||||||
|
result.push(')');
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue