Skip to content

Commit aa7401d

Browse files
author
Antonio Bennett
committed
Enhance: Add commented dependencies section to generated Cargo.toml
- Includes examples for common LeetCode crates (itertools, regex). - Allows easy extension without editing boilerplate.
1 parent 61b8b57 commit aa7401d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cmds/edit.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ if *lang == "rust" {
121121
let cargo_path = Path::new(&cargo_path_str);
122122
if !cargo_path.exists() {
123123
let package_name = format!("prob-{}-{}", problem.fid, sanitized_slug);
124-
let cargo_content = format!(
124+
let cargo_content = format!(
125125
r#"[package]
126126
name = "{}"
127127
version = "0.1.0"
@@ -131,9 +131,12 @@ edition = "2021"
131131
path = "src/lib.rs"
132132
133133
[dependencies]
134+
# Uncomment and add crates as needed for LeetCode problems, e.g.:
135+
# itertools = "0.12"
136+
# regex = "1"
134137
"#,
135-
package_name
136-
);
138+
package_name
139+
);
137140
let mut cargo_file = File::create(&cargo_path_str)?;
138141
cargo_file.write_all(cargo_content.as_bytes())?;
139142
}

0 commit comments

Comments
 (0)