rust学习日记

go固然很好,但学go最好的时间是三年前,其次是现在
而现在,rust正是三年前的go
https://kaisery.github.io/trpl-zh-cn/ch01-03-hello-cargo.html

2022.11.09

cargo new
cargo build [–release]
cargo run
cargo check

cargo.toml 中的 dependencies 中 rand = “0.8.3” 代表了 ^0.8.3 ,根据一般版本号的规定 中间的应该是次版本号 即功能性更新增强 第三个为bug修复 稳定性增强 而 0.8.3 代表的是 最少 0.8.3 最多不超过(不包含)0.9.0

而对于Cargo.lock 其包含了首次编译使用的确切版本和checksum(在toml配置中次版本系统的情况下) 以保证每次编译都是同一个结果

如果修改了次版本 则可以重新拉取指定次版本的最新版

cargo doc –open
建立所有依赖的说明文档并打开

Author: hundan
Link: https://hundan.org/2099/11/09/rust学习日记/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.