mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-14 08:25:01 +01:00
license
This commit is contained in:
parent
e5c5f6082e
commit
8d06708e6c
1 changed files with 18 additions and 1 deletions
19
README.md
19
README.md
|
|
@ -54,19 +54,20 @@ First, it applies the pass to everything in the file. If that stops the reproduc
|
||||||
in isolation. It then repeats the pass until no more changes are made by it.
|
in isolation. It then repeats the pass until no more changes are made by it.
|
||||||
|
|
||||||
The currently implemented passes are the following:
|
The currently implemented passes are the following:
|
||||||
|
|
||||||
- `pub` is replaced by `pub(crate)`. This does not have a real minimization effect on its own.
|
- `pub` is replaced by `pub(crate)`. This does not have a real minimization effect on its own.
|
||||||
- Bodies are replaced by `loop {}`. This greatly cuts down on the amount of things and makes many functions unused
|
- Bodies are replaced by `loop {}`. This greatly cuts down on the amount of things and makes many functions unused
|
||||||
- Unused imports are removed
|
- Unused imports are removed
|
||||||
- Unused functions are removed (this relies on the first step, as `pub` items are not marked as `dead_code` by rustc)
|
- Unused functions are removed (this relies on the first step, as `pub` items are not marked as `dead_code` by rustc)
|
||||||
|
|
||||||
Possible improvements:
|
Possible improvements:
|
||||||
|
|
||||||
- Delete more kinds of unused items
|
- Delete more kinds of unused items
|
||||||
- Inline small modules
|
- Inline small modules
|
||||||
- Deal with dependencies (there is experimental code in the repo that inlines them)
|
- Deal with dependencies (there is experimental code in the repo that inlines them)
|
||||||
- Somehow deal with traits
|
- Somehow deal with traits
|
||||||
- Integrate more fine-grained minimization tools such as `DustMite` or [`perses`](https://github.com/uw-pluverse/perses)
|
- Integrate more fine-grained minimization tools such as `DustMite` or [`perses`](https://github.com/uw-pluverse/perses)
|
||||||
|
|
||||||
|
|
||||||
# Cookbook
|
# Cookbook
|
||||||
|
|
||||||
## Normal project with ICE on `cargo build`
|
## Normal project with ICE on `cargo build`
|
||||||
|
|
@ -88,6 +89,7 @@ Possible improvements:
|
||||||
## Use a full script
|
## Use a full script
|
||||||
|
|
||||||
`script.sh`
|
`script.sh`
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
@ -108,3 +110,18 @@ fi
|
||||||
```
|
```
|
||||||
|
|
||||||
`cargo minimize --script-path ./script.sh`
|
`cargo minimize --script-path ./script.sh`
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Licensed under either of
|
||||||
|
|
||||||
|
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
|
||||||
|
- MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
at your option.
|
||||||
|
|
||||||
|
### Contribution
|
||||||
|
|
||||||
|
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
|
||||||
|
work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
|
||||||
|
additional terms or conditions.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue