cotton's blog

By cotton, history, 3 years ago, In English

In 2021 July, I posted a blog Use Rust in Codeforce — My practice with rust-bundler. After some work, I published a new package rust_bundler_cp, which is designed for competitive programming, and concentrating on codeforces' environment.

Quick guide:

  1. cargo install rust_bundler_cp
  2. git clone https://github.com/Endle/rust_codeforce_template.git --depth=1
  3. cd rust_codeforce_template
  4. rust_bundler_cp --input . --output /dev/shm/bundled.rs

I'm excited to introduce a new feature (experimental): Remove unused pub mod At top of my lib.rs, I have several pub mod as my code template.

pub mod pr;
pub mod algo;
pub mod nd;
pub mod multi_queue;
pub mod nums;
pub mod iters;

Although Codeforces has a generous code size limit: 64kb, it's always better to avoid unnecessary code. My new version rust_bundler_cp may examine main.rs. If a mod is not used in main.rs, it would be removed from the final output with explicit arg:
rust_bundler_cp --input . --output /dev/shm/bundled.rs --remove_unused_mod

Looking forward to your feedback!

  • Vote: I like it
  • +2
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you so much! This is exactly what I needed — I've found the excess boilerplate quite distasteful but adjusted thus far. After seeing this, I'm excited to make a shift now.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    I'm so glad that it helps! Please no hesitate to create Github issues for all bugs/suggestions/questions etc.