Skip to content

Commit dcf7174

Browse files
committed
fix: adjust content ownership in SIMD GLIBC tunable test
Use `content.clone()` for the first two `pipe_in` calls to avoid moving the string, and `content` directly for the third to consume it, ensuring proper Rust ownership handling in the test. This prevents borrow checker errors and allows the test to compile correctly.
1 parent e5662a2 commit dcf7174

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/by-util/test_wc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ fn test_simd_respects_glibc_tunables() {
835835

836836
let base = new_ucmd!()
837837
.arg("-l")
838-
.pipe_in(&content)
838+
.pipe_in(content.clone())
839839
.succeeds()
840840
.stdout_str()
841841
.trim()
@@ -844,7 +844,7 @@ fn test_simd_respects_glibc_tunables() {
844844
let no_avx512 = new_ucmd!()
845845
.arg("-l")
846846
.env("GLIBC_TUNABLES", "glibc.cpu.hwcaps=-AVX512F")
847-
.pipe_in(&content)
847+
.pipe_in(content.clone())
848848
.succeeds()
849849
.stdout_str()
850850
.trim()
@@ -853,7 +853,7 @@ fn test_simd_respects_glibc_tunables() {
853853
let no_avx2_avx512 = new_ucmd!()
854854
.arg("-l")
855855
.env("GLIBC_TUNABLES", "glibc.cpu.hwcaps=-AVX2,-AVX512F")
856-
.pipe_in(&content)
856+
.pipe_in(content)
857857
.succeeds()
858858
.stdout_str()
859859
.trim()

0 commit comments

Comments
 (0)