English 中文(简体)
在Rust存放处,有一个名为“-”的包裹,我如何在《刑法》中“使用”?
原标题:In a Rust repository there is a package with a dash "-" in the name, how do I "use" in Rust code?

我愿使用手法中的同化处理制/包装。

https://github.com/smol-rs/async-process.git

在十字架中。 它说,我可以把它放在我的“货物”项目中:

[dependencies]
async-process = "2.0.1"

我的手法是:

use async_process::Command; // this fails to find the "crate"

这确实是徒劳的。

在建筑时,检索和汇编了该表,但汇编该编码却造成这一错误:

error[E0432]: unresolved import `async_process`
 --> build.rs:4:5
  |
4 | use async_process::Command;
  |     ^^^^^^^^^^^^^ maybe a missing crate `async_process`?
  |
  = help: consider adding `extern crate async_process` to use the `async_process` crate

我随后尝试:

extern crate async_process;

得出这一错误:

error[E0463]: can t find crate for `async_process`
 --> build.rs:4:1
  |
4 | extern crate async_process;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can t find crate

How is this supposed to work ? is it some restriction placed on build.rs ?

我之所以想这样做,是因为我正在利用建筑商pa开指挥,以进行相当的标识过程,并想将其排在档案中(或在运行时打印到奥塞里)作为合成工艺: 指挥部提供了这样做的途径,即如果我能够使用。

问题回答

在货物中,使用ash。

[dependencies]
async-process = "2.0.1"

在法典中,使用强调。

use async_process::Command;

这应当奏效。

If in doubt, the crate s page on crates.io will list the name that should be used in Cargo.toml on the right hand side.

在列入法典时,总是使用强调而不是 da。





相关问题
Creating an alias for a variable

I have the following code in Rust (which will not compile but illustrates what I am after). For readability purposes, I would like to refer the same string with two different names so that the name of ...

Rust Visual Studio Code code completion not working

I m trying to learn Rust and installed the Rust extension for VSCode. But I m not seeing auto-completions for any syntax. I d like to call .trim() on String but I get no completion for it. I read that ...

热门标签