small executable size optimizations

This commit is contained in:
Mystikfluu 2022-12-29 02:02:37 +01:00
parent 763342941c
commit c3873b051b
4 changed files with 15 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/target /target
comp.bat comp.bat
comp.sh comp.sh
report.json

1
Cargo.lock generated
View File

@ -114,7 +114,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [ dependencies = [
"generic-array", "generic-array",
"rand_core",
"typenum", "typenum",
] ]

View File

@ -8,8 +8,15 @@ edition = "2021"
[dependencies] [dependencies]
home = "0.5.4" home = "0.5.4"
rpassword = "7.2" rpassword = "7.2"
rand = "0.8.5" rand = { features = ["std"], default-features = false, version = "0.8.5" }
aes-gcm = "0.10.1" aes-gcm = { features = ["alloc", "aes"], default-features = false, version = "0.10.1" }
sha2 = "0.10.6" sha2 = { default-features = false, version = "0.10.6" }
hex = "0.4.3" hex = "0.4.3"
brotli = "3.3.4" brotli = { features = ["std"], default-features = false, version = "3.3.4" }
[profile.release]
opt-level = 'z' # Optimize for size
lto = true # Enable link-time optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
strip = true # Strip symbols from binary; remove pdb

View File

@ -0,0 +1,2 @@
REM This uses cargo-unused-features
unused-features analyze && unused-features prune --input report.json