todo-replacer

Crates.iotodo-replacer
lib.rstodo-replacer
version0.1.1
created_at2025-01-14 12:30:31.606345+00
updated_at2025-01-14 12:38:36.483372+00
descriptionReplace function body with `todo!()`.
homepage
repositoryhttps://github.com/Lee-Janggun/todo-replacer
max_upload_size
id1515921
size20,439
Janggun Lee (Lee-Janggun)

documentation

README

Replace function body with todo!()

Usage

todo-replace <file-path> <csv-path>

Where is a comma separated value file with each row consists of two columns: function_name and body.

  • function_name: The name of the function to be replaced.
  • body: The new body of the function. If empty, it will be replaced with default { todo!() }. Note that body should begin and end with brackets {}, and after replacement, formatting may be off. You may need to run cargo fmt to fix it.

Example

Rust File (input.rs):

fn foo() {
    println!(\"Old body\");
}

fn bar() {
    println!(\"Another body\");
}

CSV File (replacements.csv):

foo,{ println!(\"New body\"); }
bar,{ println!(\"Updated body\"); }

Command:

todo-replacer input.rs replacements.csv

Resulting Rust File (input.rs):

fn foo() { println!(\"New body\"); }

fn bar() { println!(\"Updated body\"); }
Commit count: 5

cargo fmt