MCPcopy Create free account
hub / github.com/corrode/write-yourself-a-shell / write_stdin

Method write_stdin

tests/all/utils.rs:57–68  ·  view source on GitHub ↗
(&self, child: &mut Child)

Source from the content-addressed store, hash-verified

55 }
56
57 fn write_stdin(&self, child: &mut Child) {
58 if let Some(stdin) = self.stdin {
59 // Use scoped threads to avoid cloning stdin.
60 thread::scope(|s| {
61 s.spawn(|| {
62 let mut child_stdin = child.stdin.take().unwrap();
63 child_stdin.write_all(stdin.as_bytes()).unwrap();
64 child_stdin.flush().unwrap();
65 });
66 });
67 }
68 }
69
70 fn wait(&self, mut child: Child) -> Output {
71 if let Some(duration) = self.kill_after {

Callers 1

runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected