build: enable size optimization for release profile

This reduces the binary size from 7.3M to 6.5M.

Also the build time for a clean build shrinks from 1m28s to 1m14s on my
development machine (an eight-core VM on Azure). This goes against the
conventional wisdom but it is what it is.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2022-08-11 11:35:26 +00:00 committed by Rob Bradford
parent cb00dbe6ec
commit 9fe1643089

View File

@ -14,6 +14,8 @@ rust-version = "1.60"
[profile.release]
lto = true
codegen-units = 1
opt-level = "s"
[dependencies]
anyhow = "1.0.65"