如何使用 Cargo 运行项目示例? [英] How do I run a project's example using Cargo?

查看:49
本文介绍了如何使用 Cargo 运行项目示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从这个项目运行示例代码 .按照 Cargo 文档上的说明,我执行了以下操作:

I'm trying to run the example code from this project. Following the instructions on the Cargo docs, I did the following:

git clone https://github.com/basiliscos/rust-procol-ftp-client
cd rust-procol-ftp-client
cargo run 
cargo test

cargo test 还应该编译 示例 根据 Rust 文档.

cargo test should also have compiled the example according to the Rust docs.

虽然 cargo test 执行成功,但当我进入 target/debug 目录时,我没有找到 ftp-get 的可执行文件>(这是示例代码).target/debug/examples 目录也是空的.

Although cargo test executes successfully, when I change into the target/debug directory, I don't find an executable for ftp-get (which is the example code). The target/debug/examples directory is also empty.

运行此示例的最佳方法是什么?

What is the best way to go about running this example?

推荐答案

尝试以下操作:

cd rust-procol-ftp-client
cargo build --examples
./target/debug/examples/ftp-get

这篇关于如何使用 Cargo 运行项目示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆