- Learning Rust
- Paul Johnson Vesa Kaihlavirta
- 222字
- 2021-07-02 23:07:13
Cleaning your source tree with Cargo
When the Rust compiler compiles the source files, it generates something known as an object file. The object file takes the source file (which we can read and understand) and compiles this into a form that can be joined with other libraries to create a binary.
This is a good idea, as it cuts down on compilation time; if a source file has not been changed, there is no need to recompile the file, as the object file will be the same.
Sometimes, the object file becomes out of date, or code in another object file causes a panic due to conflicts. In this case, it is not uncommon to "clean" the build. This removes the object files, and the compiler then has to recompile all the source files.
Also, it should always be performed prior to creating a release build.
The standard Unix make program performs this with the clean command (make clean). Cargo performs the clean operation in a way similar to the make utility in Unix:
cargo clean
A comparison of the directories shows what happens when using the preceding Cargo command:

The entire target directory structure has simply been removed (the preceding screenshot was from a Mac, hence the dSYM and plist files. These do not exist on Linux and Windows).
- Python入門很簡單
- Android Application Development Cookbook(Second Edition)
- 編程珠璣(續)
- Animate CC二維動畫設計與制作(微課版)
- 數據結構與算法JavaScript描述
- MATLAB應用與實驗教程
- 人人都懂設計模式:從生活中領悟設計模式(Python實現)
- D3.js By Example
- Mastering Linux Security and Hardening
- Unity 2018 Augmented Reality Projects
- Clojure for Java Developers
- Vue.js 3應用開發與核心源碼解析
- Learning Ionic
- ASP.NET 4.0 Web程序設計
- Scratch從入門到精通