知识卡片
按产物选择Cargo命令
cargo check 适合快速发现编译错误。cargo build 生成可执行产物,cargo run 构建后启动。准备发布或比较运行性能时,按书中的方法用 cargo build --release 得到优化产物,避免对调试构建测得的速度作发布判断。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 入门 Hello, Cargo! · 查看原书依据
Why would you not want an executable? Often, cargo check is much faster than cargo build because it skips the step of producing an executable. If you’re continually checking your work while writing the code, using cargo check will speed up the process of letting you know if your project is still compiling!
参考来源
- 位置:《The Rust Programming Language(第2版)》第01章 入门(来源项目 a19c7933-4eda-4176-aebd-30fe7e1ad292,`extracted/The Rust Programming Language(第2版)/_epub-src/c01.xhtml`,块 0143)
- 结论依据:原文说明 check 省去生成程序的步骤,并把它放到开发反馈循环。
- 原始内容:Why would you not want an executable? Often, cargo check is much faster than cargo build because it skips the step of producing an executable. If you’re continually checking your work while writing the code, using cargo check will speed up the process of letting you know if your project is still compiling!