Merge pull request #205 from ouch-org/fix-format-infer

Fix error with format infer
This commit is contained in:
João Marcos Bezerra 2021-11-14 02:15:08 -03:00 committed by GitHub
commit 1dc06e798a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -507,7 +507,7 @@ fn check_mime_type(
} else if let Some(detected_format) = try_infer_extension(path) {
// File ending with extension
// Try to detect the extension and warn the user if it differs from the written one
let outer_ext = format.iter().next().unwrap();
let outer_ext = format.iter().next_back().unwrap();
if outer_ext != &detected_format {
warning!(
"The file extension: `{}` differ from the detected extension: `{}`",