| Crates.io | todo-replacer |
| lib.rs | todo-replacer |
| version | 0.1.1 |
| created_at | 2025-01-14 12:30:31.606345+00 |
| updated_at | 2025-01-14 12:38:36.483372+00 |
| description | Replace function body with `todo!()`. |
| homepage | |
| repository | https://github.com/Lee-Janggun/todo-replacer |
| max_upload_size | |
| id | 1515921 |
| size | 20,439 |
todo!()todo-replace <file-path> <csv-path>
Where 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.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\"); }