Skip to content

Commit c9ce9e2

Browse files
committed
Fix getting extension
1 parent 2574289 commit c9ce9e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ macro_rules! impl_formats {
8383
if buf.is_empty() {
8484
return Err(Error::new(ErrorKind::Other, "File is empty or there was an error trying to load it."));
8585
}
86-
let ext = filepath.as_ref().extension().map(|x| x.to_ascii_lowercase().to_string_lossy().to_owned().to_string());
86+
let ext = Some(filesystem::get_extension(filepath.as_ref().to_str().unwrap_or_default()).to_ascii_lowercase()).filter(|x| !x.is_empty());
8787
{$(
8888
let exts = <$class>::possible_extensions();
8989
let mut check = true;

0 commit comments

Comments
 (0)