Skip to content

Commit

Permalink
Tweak string conversion for MSRV compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
EliahKagan committed Sep 22, 2024
1 parent 66df3f5 commit e66a998
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zng/cmake.rs
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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.
Expand Down

0 comments on commit e66a998

Please sign in to comment.