File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
use std:: path:: Path ;
2
2
3
- use crate :: GIT_README ;
4
3
use crate :: file_parser:: codefile:: CodeFile ;
5
4
use crate :: handlers:: leetcode:: { Authorized , LeetCode } ;
6
5
use crate :: handlers:: utils:: { ExecutionResult , SubmissionResult } ;
6
+ use crate :: GIT_README ;
7
7
8
8
use eyre:: { bail, Result } ;
9
9
@@ -65,7 +65,7 @@ pub(crate) fn pack(lc: &LeetCode<Authorized>, file: Option<std::path::PathBuf>)
65
65
// create a directory if it doesn't exists with name of question
66
66
// create a README.md file with the question description
67
67
// create a file with the code
68
- std:: fs:: create_dir_all ( & code_file. question_title . replace ( ' ' , "" ) ) ?;
68
+ std:: fs:: create_dir_all ( & code_file. question_title ) ?;
69
69
70
70
std:: fs:: write (
71
71
format ! (
@@ -88,7 +88,11 @@ pub(crate) fn pack(lc: &LeetCode<Authorized>, file: Option<std::path::PathBuf>)
88
88
) ;
89
89
std:: io:: Write :: write_all (
90
90
& mut readme_file,
91
- format ! ( "# {}\n " , code_file. question_title) . as_bytes ( ) ,
91
+ format ! (
92
+ "# {title}\n [Link to Problem](https://leetcode.com/problems/{title}/description)\n \n " ,
93
+ title = code_file. question_title
94
+ )
95
+ . as_bytes ( ) ,
92
96
) ?;
93
97
std:: io:: Write :: write_all ( & mut readme_file, question. content . as_bytes ( ) ) ?;
94
98
} else {
You can’t perform that action at this time.
0 commit comments