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 11use std:: path:: Path ;
22
3- use crate :: GIT_README ;
43use crate :: file_parser:: codefile:: CodeFile ;
54use crate :: handlers:: leetcode:: { Authorized , LeetCode } ;
65use crate :: handlers:: utils:: { ExecutionResult , SubmissionResult } ;
6+ use crate :: GIT_README ;
77
88use eyre:: { bail, Result } ;
99
@@ -65,7 +65,7 @@ pub(crate) fn pack(lc: &LeetCode<Authorized>, file: Option<std::path::PathBuf>)
6565 // create a directory if it doesn't exists with name of question
6666 // create a README.md file with the question description
6767 // 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 ) ?;
6969
7070 std:: fs:: write (
7171 format ! (
@@ -88,7 +88,11 @@ pub(crate) fn pack(lc: &LeetCode<Authorized>, file: Option<std::path::PathBuf>)
8888 ) ;
8989 std:: io:: Write :: write_all (
9090 & 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 ( ) ,
9296 ) ?;
9397 std:: io:: Write :: write_all ( & mut readme_file, question. content . as_bytes ( ) ) ?;
9498 } else {
You can’t perform that action at this time.
0 commit comments