File tree 1 file changed +3
-3
lines changed 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -93,12 +93,12 @@ static ARROWS_NAME_STRUCTURE: Lazy<Regex> = Lazy::new(|| {
93
93
94
94
/// Returns the filename for parquet if provided arrows file path is valid as per our expectation
95
95
fn arrow_path_to_parquet ( path : & Path , random_string : & str ) -> Option < PathBuf > {
96
- let filename = path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
97
- let filename = ARROWS_NAME_STRUCTURE
96
+ let filename = path. file_name ( ) ? . to_str ( ) ? ;
97
+ let front = ARROWS_NAME_STRUCTURE
98
98
. captures ( filename)
99
99
. and_then ( |c| c. get ( 1 ) ) ?
100
100
. as_str ( ) ;
101
- let filename_with_random_number = format ! ( "{filename }.data.{random_string}.parquet" ) ;
101
+ let filename_with_random_number = format ! ( "{front }.data.{random_string}.parquet" ) ;
102
102
let mut parquet_path = path. to_owned ( ) ;
103
103
parquet_path. set_file_name ( filename_with_random_number) ;
104
104
You can’t perform that action at this time.
0 commit comments