Fix edition used for include macro parsing

This commit is contained in:
Lukas Wirth 2024-07-19 20:04:38 +02:00
parent f4199f786e
commit 92f5e806f1
6 changed files with 17 additions and 13 deletions

View file

@ -6,7 +6,7 @@ use std::{
time::{Instant, SystemTime, UNIX_EPOCH},
};
use anyhow::{bail, format_err};
use anyhow::format_err;
use xshell::{cmd, Shell};
use crate::flags::{self, MeasurementType};
@ -193,7 +193,7 @@ impl Metrics {
impl Host {
fn new(sh: &Shell) -> anyhow::Result<Host> {
if cfg!(not(target_os = "linux")) {
bail!("can only collect metrics on Linux ");
return Ok(Host { os: "unknown".into(), cpu: "unknown".into(), mem: "unknown".into() });
}
let os = read_field(sh, "/etc/os-release", "PRETTY_NAME=")?.trim_matches('"').to_owned();