From 7f30be88e33371a0ccdcef1536d24b4c7dc49cfa Mon Sep 17 00:00:00 2001 From: Lena <126529524+acuteenvy@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:04:27 +0100 Subject: [PATCH] Remove redundant `to_str()` conversion (#2527) --- 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 938c514e..20820df9 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())