生锈的货物释放不优化的问题
为什么我的项目还在说“我不优化”?
; 我正在做一个版本,它说它优化了 但是当我输入货物检查命令时,它说不在
Why my project still saying "i am unoptimized"?
I am doing a normal build and terminal says this build is unoptimized
And i am doing a release build and it says it optimized
but when i enter cargo check command it says unoptimized
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因为
未取代 + debuginfo
是货物中 all 命令的默认值。要在版本中运行任何命令,请添加
- 版本
标志,如cargo build
:Because
unoptimized + debuginfo
is the default for all commands in cargo.To run any command in release, please add the
--release
flag as you already did withcargo build
:要在调试模式下进行优化的构建,将这些行添加到您的
cargo.toml
:您可以在此处找到有关自定义构建配置文件的更多信息: https://doc.rust-lang.org/book/ch14-01-release-profiles.html
For optimized builds in debug mode add these lines to your
Cargo.toml
:You can find more information about customizing build profiles here: https://doc.rust-lang.org/book/ch14-01-release-profiles.html