use anyhow::Result; pub fn host_name() -> Result { Ok(hostname::get()? .into_string() .map_err(|_| anyhow::Error::msg("Failed converting OsString in host_name"))?) }