[英]Is there any way to rename a Cargo project?
我認為您應該手動更改它。 沒那么難,真的。
我運行這個代碼:
$ cargo new smurf --bin
Created binary (application) `smurf` project
$ cd smurf/
smurf$ cargo build
....
smurf$ grep -rl smurf .
./target/debug/smurf.d
./target/debug/smurf
./target/debug/.fingerprint/smurf-35f069edf7faaa12/bin-smurf-35f069edf7faaa12.json
./target/debug/.fingerprint/smurf-35f069edf7faaa12/dep-bin-smurf-35f069edf7faaa12
./target/debug/deps/smurf-35f069edf7faaa12
./Cargo.lock
./Cargo.toml
從所有這些文件中,整個target
可能會被刪除。 .lock
文件也可以刪除。 還有Cargo.toml
......好吧,你可以編輯它。
我嘗試只更改Cargo.toml
並且一切正常。 然而,你最終在target
得到了無用的文件,所以我建議無論如何刪除這些文件。
在 Linux 下,這是相當嚴格的:
pi@raspberrypi:~/workspace/rust/hello_world $ cd ..
mv hello_world/ hello_rust/
來重命名文件夾。pi@raspberrypi:~/workspace/rust $ cd hello_rust/
pi@raspberrypi:~/workspace/rust/hello_rust $ geany Cargo.toml
name = "hello_world"
到name = "hello_rust"
希望這可能會在將來對某人有所幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.