From e66a998d27882db51eeb40ab42473ec3dcc4c6c2 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sun, 22 Sep 2024 07:54:17 -0400 Subject: [PATCH] Tweak string conversion for MSRV compatibility --- zng/cmake.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zng/cmake.rs b/zng/cmake.rs index 6bfc949..81456eb 100644 --- a/zng/cmake.rs +++ b/zng/cmake.rs @@ -1,5 +1,4 @@ use std::env; -use std::ffi::OsStr; pub fn build_zlib_ng(target: &str, compat: bool) { let mut cmake = cmake::Config::new("src/zlib-ng"); @@ -19,10 +18,10 @@ pub fn build_zlib_ng(target: &str, compat: bool) { // Check if we should pass on an explicit boolean value of the WITH_RVV build option. // See: https://github.com/zlib-ng/zlib-ng?tab=readme-ov-file#advanced-build-options match env::var_os("RISCV_WITH_RVV") - .map(OsStr::to_str) + .map(|v| v.to_str()) .map(str::trim) .map(str::to_uppercase) - .map(Into::into) + .as_deref() { Some("OFF" | "NO" | "FALSE" | "0") => { // Force RVV off. This turns off RVV entirely, as well as the runtime check for it.