Skip to content

Commit

Permalink
use || instead of if, else if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantiago2719 committed Jan 21, 2023
1 parent d1dcff7 commit 2a8bed3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils.rs
Expand Up @@ -28,9 +28,8 @@ impl FileMetaData {
let file_path = Path::new(path);
let file_name_os_str = file_path.file_stem().unwrap();

if file_path.is_dir() {
Ok(file_name_os_str.to_str().unwrap().to_owned())
} else if file_path.extension().unwrap().to_str().unwrap() == "heic" {
if file_path.is_dir() ||
file_path.extension().unwrap().to_str().unwrap() == "heic" {
Ok(file_name_os_str.to_str().unwrap().to_owned())
} else {
Err("File type not supported")
Expand Down

0 comments on commit 2a8bed3

Please sign in to comment.