官术网_书友最值得收藏!

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).

主站蜘蛛池模板: 丹凤县| 太仆寺旗| 韶山市| 西峡县| 兴山县| 东莞市| 雷山县| 普安县| 泸定县| 五河县| 车致| 建阳市| 新邵县| 石河子市| 敦煌市| 深泽县| 静安区| 高台县| 荆门市| 化德县| 大港区| 乐山市| 莒南县| 会泽县| 府谷县| 扬中市| 多伦县| 长丰县| 江都市| 泰宁县| 茌平县| 桓仁| 湛江市| 神池县| 民和| 洛浦县| 深圳市| 绥德县| 治县。| 焦作市| 望城县|