File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ use std::path::Path;
108108let question: Question = qr?;
109109
110110if * lang == "rust" {
111- let sanitized_slug = problem. slug . replace ( |c : char | !c. is_alphanumeric ( ) , "_" ) ;
111+ let sanitized_slug = problem. slug . to_lowercase ( ) . replace ( |c : char | !c. is_alphanumeric ( ) , "_" ) ;
112112 let code_dir_str = format ! ( "{}/{}-{}" , conf. storage. code( ) ?, problem. fid, sanitized_slug) ;
113113 let code_dir = Path :: new ( & code_dir_str) ;
114114 fs:: create_dir_all ( code_dir) ?;
@@ -120,7 +120,7 @@ if *lang == "rust" {
120120 let cargo_path_str = format ! ( "{}/Cargo.toml" , code_dir_str) ;
121121 let cargo_path = Path :: new ( & cargo_path_str) ;
122122 if !cargo_path. exists ( ) {
123- let package_name = format ! ( "leetcode -{}-{}" , problem. fid, sanitized_slug) ;
123+ let package_name = format ! ( "prob -{}-{}" , problem. fid, sanitized_slug) ;
124124 let cargo_content = format ! (
125125r#"[package]
126126name = "{}"
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ pub fn test_cases_path(problem: &Problem) -> crate::Result<String> {
200200 let code_base = conf. storage . code ( ) ?;
201201
202202 let path = if lang == "rust" {
203- let sanitized_slug = problem. slug . replace ( |c : char | !c. is_alphanumeric ( ) , "_" ) ;
203+ let sanitized_slug = problem. slug . to_lowercase ( ) . replace ( |c : char | !c. is_alphanumeric ( ) , "_" ) ;
204204 let subdir = format ! ( "{}-{}/tests.dat" , problem. fid, sanitized_slug) ;
205205 format ! ( "{}/{}" , code_base, subdir)
206206 } else {
@@ -224,7 +224,7 @@ pub fn code_path(problem: &Problem, l: Option<String>) -> crate::Result<String>
224224 let code_base = conf. storage . code ( ) ?;
225225
226226 let path = if lang == "rust" {
227- let sanitized_slug = problem. slug . replace ( |c : char | !c. is_alphanumeric ( ) , "_" ) ;
227+ let sanitized_slug = problem. slug . to_lowercase ( ) . replace ( |c : char | !c. is_alphanumeric ( ) , "_" ) ;
228228 let subdir = format ! ( "{}-{}/src/lib.rs" , problem. fid, sanitized_slug) ;
229229 format ! ( "{}/{}" , code_base, subdir)
230230 } else {
You can’t perform that action at this time.
0 commit comments