diff --git a/crates/oyster_runtime/tests/it/pipeline.rs b/crates/oyster_runtime/tests/it/pipeline.rs index 29dae32..fe00e9f 100644 --- a/crates/oyster_runtime/tests/it/pipeline.rs +++ b/crates/oyster_runtime/tests/it/pipeline.rs @@ -1,10 +1,10 @@ use std::{ borrow::Cow, env, - ffi::OsStr, + ffi::{OsStr, OsString}, fs::File, io::{BufRead, BufReader, Write}, - os::unix::io::FromRawFd, + os::unix::{ffi::OsStringExt, io::FromRawFd}, process, }; @@ -30,7 +30,7 @@ fn test_builtin(_: &mut Shell, _: &[Cow]) { /// Forks to redirect stdin, stderr, stdout, then run the commands. /// Relies on inserting a NUL byte in the end, so there shouldn't be NUL in the output. -fn collect_output(mut f: F) -> String +fn collect_output(mut f: F) -> OsString where F: FnMut(), { @@ -65,9 +65,7 @@ where let mut buf = vec![]; r.read_until(0, &mut buf).unwrap(); - std::str::from_utf8(&buf[..buf.len() - 1]) - .unwrap() - .to_owned() + OsString::from_vec(buf[..buf.len() - 1].to_vec()) } #[test]