Rust Sourcebundler Save

Bundle the source code of a binary in a crate into a single .rs file to be used in single-file programming competition sites

Project README

CI coveralls


Bundle the source code of a rust cargo crate in a single source file.

Very useful for sending the source code to a competitive programming site that accept only a single file (codingame, I'm looking at you) and still keeping the cargo structure locally.


Add the following snippet to your Cargo.toml:

build = ""

rustsourcebundler = { git = "" }

And create the file with the following:

//! Bundle and the crate libraries into

use std::path::Path;
extern crate rustsourcebundler;
use rustsourcebundler::Bundler;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut bundler: Bundler = Bundler::new(Path::new("src/bin/"),
    bundler.crate_name("<crate name>");;

You can use the code inside the example directory of this repository as a starting point.

Similar Projects

Open Source Agenda is not affiliated with "Rust Sourcebundler" Project. README Source: lpenz/rust-sourcebundler
Open Issues
Last Commit
1 month ago

Open Source Agenda Badge

Open Source Agenda Rating