diff --git a/.gitignore b/.gitignore index 9e50c14..5aba510 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target comp.bat -comp.sh \ No newline at end of file +comp.sh +report.json \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 4d3fcab..d0dda63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,7 +114,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", "typenum", ] diff --git a/Cargo.toml b/Cargo.toml index 8a436ee..588eb30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,15 @@ edition = "2021" [dependencies] home = "0.5.4" rpassword = "7.2" -rand = "0.8.5" -aes-gcm = "0.10.1" -sha2 = "0.10.6" +rand = { features = ["std"], default-features = false, version = "0.8.5" } +aes-gcm = { features = ["alloc", "aes"], default-features = false, version = "0.10.1" } +sha2 = { default-features = false, version = "0.10.6" } hex = "0.4.3" -brotli = "3.3.4" \ No newline at end of file +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 diff --git a/optimize_dependencies.bat b/optimize_dependencies.bat new file mode 100644 index 0000000..25fb54b --- /dev/null +++ b/optimize_dependencies.bat @@ -0,0 +1,2 @@ +REM This uses cargo-unused-features +unused-features analyze && unused-features prune --input report.json \ No newline at end of file