Fix error with format infer

This commit is contained in:
João Marcos Bezerra 2021-11-14 02:14:51 -03:00 committed by GitHub
parent dc78c96c3f
commit 92372813a5
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) { } else if let Some(detected_format) = try_infer_extension(path) {
// File ending with extension // File ending with extension
// Try to detect the extension and warn the user if it differs from the written one // 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 { if outer_ext != &detected_format {
warning!( warning!(
"The file extension: `{}` differ from the detected extension: `{}`", "The file extension: `{}` differ from the detected extension: `{}`",