Skip to content

๐Ÿ‡บ๐Ÿ‡ฆ rust-bundler-cp bundles a cargo package into a single rust file. It's designed for Competitive programming like Codeforces. ๐Ÿ‡บ๐Ÿ‡ฆ

License

Notifications You must be signed in to change notification settings

Endle/rust-bundler-cp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Stand With Ukraine rust-bundler-cp

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.

Features

  • Uses Syn to parse and manipulate a complete syntax tree, instead of doing replacement with regular expression.
  • Replaces extern crate my_lib; in main.rs with the contents of lib.rs.
  • Expands mod my_mod; declarations into mod my_mod { ... } blocks.
  • rustfmt needs to be available in PATH, i.e. dnf install rustfmt. I'll consider bundle rustfmt in my code later.
  • Unsupported: External [dependencies] in Cargo.toml

Example

Endle's codeforces template is co-evoloved with rust-bundler-cp, and is considered as the example of it.

Usage

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

Similar Projects

About

๐Ÿ‡บ๐Ÿ‡ฆ rust-bundler-cp bundles a cargo package into a single rust file. It's designed for Competitive programming like Codeforces. ๐Ÿ‡บ๐Ÿ‡ฆ

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6