We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2574289 commit c9ce9e2Copy full SHA for c9ce9e2
src/lib.rs
@@ -83,7 +83,7 @@ macro_rules! impl_formats {
83
if buf.is_empty() {
84
return Err(Error::new(ErrorKind::Other, "File is empty or there was an error trying to load it."));
85
}
86
- let ext = filepath.as_ref().extension().map(|x| x.to_ascii_lowercase().to_string_lossy().to_owned().to_string());
+ let ext = Some(filesystem::get_extension(filepath.as_ref().to_str().unwrap_or_default()).to_ascii_lowercase()).filter(|x| !x.is_empty());
87
{$(
88
let exts = <$class>::possible_extensions();
89
let mut check = true;
0 commit comments