blob: d7cd4af8ee8d38686195857ef41a82935b0df552 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
use std::process::Command;
use datatype::Error;
/// Generate a new system information report.
pub fn system_info(cmd: &str) -> Result<String, Error> {
Command::new(cmd)
.output()
.map_err(|err| Error::SystemInfo(err.to_string()))
.and_then(|info| String::from_utf8(info.stdout).map_err(Error::FromUtf8))
}
|