Skip to content

Commit b943755

Browse files
committed
Better regex for automatic fill return value
1 parent 9345b6e commit b943755

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn parse_discuss_link(problem: &Problem) -> String {
203203
}
204204

205205
fn insert_return_in_code(return_type: &str, code: &str) -> String {
206-
let re = Regex::new(r"\{[ \n]+}").unwrap();
206+
let re = Regex::new(r"\{[\s\n]+\}").unwrap();
207207
match return_type {
208208
"ListNode" => re
209209
.replace(&code, "{\n Some(Box::new(ListNode::new(0)))\n }")

0 commit comments

Comments
 (0)