我正在尝试在 Rust 中执行以下代码:
use std::io::Command;
fn main() {
let the_output = Command::new("ruby").arg(["-e", "puts 'raja'", "x"]).output()
}
但是它抛出这个错误:
error[E0432]: unresolved import `std::io::Command`
--> src\main.rs:1:5
|
1 | use std::io::Command;
| ^^^^^^^^^^^^^^^^ no `Command` in `io`
有人可以指导我如何将此 use std::io::Command;
导入我的程序吗?
最佳答案
没有 std::io::Command
。你可能在想 std::process::Command
.
关于rust - 如何使用 `std::io::Command`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55662435/