From b034879eaec93e5b658055f56a94b53614fce029 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 16 Sep 2021 17:02:01 +0200 Subject: [PATCH] HighlightingAssets: No need for both path and path_str --- src/assets.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/assets.rs b/src/assets.rs index dfdb8843..b4fca157 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -201,7 +201,7 @@ impl HighlightingAssets { // Get the path of the file: // If this was set by the metadata, that will take priority. // If it wasn't, it will use the real file path (if available). - let path_str = input + let path = input .metadata .user_provided_name .as_ref() @@ -210,9 +210,8 @@ impl HighlightingAssets { _ => None, }); - let path_syntax = if let Some(path_str) = path_str { + let path_syntax = if let Some(path) = path { // If a path was provided, we try and detect the syntax based on extension mappings. - let path = Path::new(path_str); let absolute_path = PathAbs::new(path) .ok() .map(|p| p.as_path().to_path_buf())