From 751349a76a5c82b42e128c39e18449eaf5ad9041 Mon Sep 17 00:00:00 2001 From: Lena <126529524+acuteenvy@users.noreply.github.com> Date: Wed, 19 Feb 2025 21:39:27 +0100 Subject: [PATCH] Remove redundant `to_str()` conversion --- src/ui/syntax_text.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ui/syntax_text.rs b/src/ui/syntax_text.rs index 938c514e7c..20820df915 100644 --- a/src/ui/syntax_text.rs +++ b/src/ui/syntax_text.rs @@ -76,9 +76,7 @@ impl SyntaxText { scope_time!("syntax_highlighting.0"); let plain_text = || SYNTAX_SET.find_syntax_plain_text(); let syntax = SYNTAX_SET - .find_syntax_for_file( - file_path.to_str().unwrap_or_default(), - ) + .find_syntax_for_file(file_path) .unwrap_or_else(|e| { log::error!("Could not read the file to detect its syntax: {e}"); Some(plain_text())