refactor: remove usage of async writing to child stdin

Co-authored-by: Filip Tibell <filip.tibell@gmail.com>
This commit is contained in:
Erica Marigold 2023-09-27 16:50:59 +05:30 committed by GitHub
parent 6f9a9efa21
commit a480c1dc8e
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,15 +220,10 @@ async fn spawn_command(
// If the stdin option was provided, we write that to the child
if let Some(stdin) = stdin {
let mut child_stdin = child.stdin.take().unwrap();
let _ = task::spawn(async move {
let mut tee = AsyncTeeWriter::new(&mut child_stdin);
tee.write_all(stdin.as_bytes()).await.into_lua_err()?;
Ok::<(), LuaError>(())
})
.await
.expect("Tee writer for stdin errored");
child_stdin
.write_all(stdin.as_bytes())
.await
.into_lua_err()?;
}
if inherit_stdio {