File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ fn get_temp_path(path: &Path) -> PathBuf {
1515 let file_name = path. file_name ( ) . and_then ( |n| n. to_str ( ) ) . unwrap_or ( "temp" ) ;
1616 let unique_id = COUNTER . fetch_add ( 1 , Ordering :: Relaxed ) ;
1717 let pid = std:: process:: id ( ) ;
18- temp_path. set_file_name ( format ! ( "tmp_{}_{}_{}_ .tmp" , file_name, pid, unique_id) ) ;
18+ temp_path. set_file_name ( format ! ( ".{}.{}.{} .tmp" , file_name, pid, unique_id) ) ;
1919 temp_path
2020}
2121
@@ -74,10 +74,10 @@ mod tests {
7474 // Check temp file is in same directory as original
7575 assert_eq ! ( temp1. parent( ) , path. parent( ) ) ;
7676
77- // Check temp file name starts with tmp_ and ends with .tmp
77+ // Check temp file name starts with dot and ends with .tmp
7878 let file_name = temp1. file_name ( ) . unwrap ( ) . to_string_lossy ( ) ;
79- assert ! ( file_name. starts_with( "tmp_file.dat_ " ) ) ;
80- assert ! ( file_name. ends_with( "_ .tmp" ) ) ;
79+ assert ! ( file_name. starts_with( ".file.dat. " ) ) ;
80+ assert ! ( file_name. ends_with( ".tmp" ) ) ;
8181 }
8282
8383 #[ tokio:: test]
You can’t perform that action at this time.
0 commit comments