Skip to content

Commit a1b2d3d

Browse files
committed
Tweak string conversion
For correctness and MSRV compatibility.
1 parent 66df3f5 commit a1b2d3d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

zng/cmake.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::env;
2-
use std::ffi::OsStr;
32

43
pub fn build_zlib_ng(target: &str, compat: bool) {
54
let mut cmake = cmake::Config::new("src/zlib-ng");
@@ -19,10 +18,8 @@ pub fn build_zlib_ng(target: &str, compat: bool) {
1918
// Check if we should pass on an explicit boolean value of the WITH_RVV build option.
2019
// See: https://github.com/zlib-ng/zlib-ng?tab=readme-ov-file#advanced-build-options
2120
match env::var_os("RISCV_WITH_RVV")
22-
.map(OsStr::to_str)
23-
.map(str::trim)
24-
.map(str::to_uppercase)
25-
.map(Into::into)
21+
.and_then(|v| v.to_str())
22+
.map(|s| s.trim().to_uppercase().as_ref())
2623
{
2724
Some("OFF" | "NO" | "FALSE" | "0") => {
2825
// Force RVV off. This turns off RVV entirely, as well as the runtime check for it.

0 commit comments

Comments
 (0)