This project is based on rust-bundler
Creates a single-source-file version of a Cargo package. It's designed for Competitive Programming like Codeforces.
- Uses Syn to parse and manipulate a complete syntax tree, instead of doing replacement with regular expression.
- Replaces
extern crate my_lib;
inmain.rs
with the contents oflib.rs
. - Expands
mod my_mod;
declarations intomod my_mod { ... }
blocks. - rustfmt needs to be available in
PATH
, i.e.dnf install rustfmt
. I'll consider bundlerustfmt
in my code later.
Endle's codeforces template is co-evoloved with rust-bundler-cp, and is considered as the example of it.
Install:
$ cargo install rust_bundler_cp
Run:
$ rust_bundler_cp --input path/to/project >output.rs
$ rust_bundler_cp --input path/to/project --binary a
- This project is based on slava-sh /rust-bundler
- lpenz/rust-sourcebundler is based on regular expressions, whereas this project manipulates the syntax tree
- MarcosCosmos/cg-rust-bundler
- golang.org/x/tools/cmd/bundle for Go