From 92372813a50322a8ebca8499af29bb8adbde0950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Bezerra?= Date: Sun, 14 Nov 2021 02:14:51 -0300 Subject: [PATCH] Fix error with format infer --- src/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index 5a2dcee..68f324c 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -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: `{}`",