Skip to content

Commit c3f133e

Browse files
author
Devdutt Shenoi
committed
doc: code readability improvements
1 parent 2995cac commit c3f133e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parseable/streams.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ static ARROWS_NAME_STRUCTURE: Lazy<Regex> = Lazy::new(|| {
9393

9494
/// Returns the filename for parquet if provided arrows file path is valid as per our expectation
9595
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
9898
.captures(filename)
9999
.and_then(|c| c.get(1))?
100100
.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");
102102
let mut parquet_path = path.to_owned();
103103
parquet_path.set_file_name(filename_with_random_number);
104104

0 commit comments

Comments
 (0)