@@ -108,9 +108,8 @@ impl<Location: AsUrl> ParsedLogPath<Location> {
108108 #[ internal_api]
109109 pub ( crate ) fn try_from ( location : Location ) -> Option < ParsedLogPath < Location > > {
110110 let url = location. as_url ( ) ;
111- let Some ( mut path_segments) = url. path_segments ( ) else {
112- return None ;
113- } ;
111+ let mut path_segments = url. path_segments ( ) ?;
112+
114113 #[ allow( clippy:: unwrap_used) ]
115114 let filename = path_segments
116115 . next_back ( )
@@ -176,24 +175,16 @@ impl<Location: AsUrl> ParsedLogPath<Location> {
176175 [ "crc" ] if in_delta_log_dir => LogPathFileType :: Crc ,
177176 [ "checkpoint" , "parquet" ] if in_delta_log_dir => LogPathFileType :: SinglePartCheckpoint ,
178177 [ "checkpoint" , uuid, "json" | "parquet" ] if in_delta_log_dir => {
179- let Some ( _) = parse_path_part :: < String > ( uuid, UUID_PART_LEN ) else {
180- return None ;
181- } ;
178+ let _ = parse_path_part :: < String > ( uuid, UUID_PART_LEN ) ?;
182179 LogPathFileType :: UuidCheckpoint
183180 }
184181 [ hi, "compacted" , "json" ] if in_delta_log_dir => {
185- let Some ( hi) = parse_path_part ( hi, VERSION_LEN ) else {
186- return None ;
187- } ;
182+ let hi = parse_path_part ( hi, VERSION_LEN ) ?;
188183 LogPathFileType :: CompactedCommit { hi }
189184 }
190185 [ "checkpoint" , part_num, num_parts, "parquet" ] if in_delta_log_dir => {
191- let Some ( part_num) = parse_path_part ( part_num, MULTIPART_PART_LEN ) else {
192- return None ;
193- } ;
194- let Some ( num_parts) = parse_path_part ( num_parts, MULTIPART_PART_LEN ) else {
195- return None ;
196- } ;
186+ let part_num = parse_path_part ( part_num, MULTIPART_PART_LEN ) ?;
187+ let num_parts = parse_path_part ( num_parts, MULTIPART_PART_LEN ) ?;
197188
198189 // A valid part_num must be in the range [1, num_parts]
199190 if !( 0 < part_num && part_num <= num_parts) {
@@ -472,10 +463,7 @@ mod tests {
472463 // ignored - no extension
473464 let log_path = table_log_dir. join ( "00000000000000000010" ) . unwrap ( ) ;
474465 let result = ParsedLogPath :: try_from ( log_path) ;
475- assert ! (
476- matches!( result, None ) ,
477- "Expected Ok(None) for missing file extension"
478- ) ;
466+ assert ! ( result. is_none( ) ) ;
479467
480468 // empty extension - should be treated as unknown file type
481469 let log_path = table_log_dir. join ( "00000000000000000011." ) . unwrap ( ) ;
0 commit comments