Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qryxip/rustminify
A tool for minifying Rust code
https://github.com/qryxip/rustminify
Last synced: 24 days ago
JSON representation
A tool for minifying Rust code
- Host: GitHub
- URL: https://github.com/qryxip/rustminify
- Owner: qryxip
- License: apache-2.0
- Created: 2021-07-31T07:12:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-06T06:26:40.000Z (over 1 year ago)
- Last Synced: 2024-11-15T00:48:24.370Z (about 1 month ago)
- Language: Rust
- Size: 36.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# rustminify
[![CI](https://github.com/qryxip/rustminify/workflows/CI/badge.svg)](https://github.com/qryxip/rustminify/actions?workflow=CI)
[![codecov](https://codecov.io/gh/qryxip/rustminify/branch/master/graph/badge.svg)](https://codecov.io/gh/qryxip/rustminify/branch/master)
[![dependency status](https://deps.rs/repo/github/qryxip/rustminify/status.svg)](https://deps.rs/repo/github/qryxip/rustminify)A tool for minifying Rust code.
## [`rustminify-cli`](https://crates.io/crates/rustminify-cli) (Binary)
[![Crates.io](https://img.shields.io/crates/v/rustminify-cli.svg)](https://crates.io/crates/rustminify-cli)
[![Crates.io](https://img.shields.io/crates/l/rustminify-cli.svg)](https://crates.io/crates/rustminify-cli)```console
❯ cargo install rustminify-cli
``````console
❯ rustminify --remove-docs < i32 {
1 + 1
}
}
EOF
fn main(){println!("{}",module::f());}mod module{pub(crate)fn f()->i32{1+1}}
```## [`rustminify`](https://crates.io/crates/rustminify) (Library)
[![Crates.io](https://img.shields.io/crates/v/rustminify.svg)](https://crates.io/crates/rustminify)
[![Crates.io](https://img.shields.io/crates/l/rustminify.svg)](https://crates.io/crates/rustminify)```console
❯ cargo add rustminify
``````rust
use syn::parse_quote;assert_eq!(
r#"fn main(){println!("{}",module::f());}mod module{pub(crate)fn f()->i32{1+1}}"#,
rustminify::minify_file(&rustminify::remove_docs(parse_quote! {
//! crate-level docfn main() {
println!("{}", module::f());
}mod module {
//! module-level doc/// doc for an item
pub(crate) fn f() -> i32 {
1 + 1
}
}
})),
);
```## License
Dual-licensed under [MIT](https://opensource.org/licenses/MIT) or [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0).