ide: Fix warnings about clippy str_to_string rule

This commit is contained in:
Tetsuharu Ohzeki 2024-02-10 00:26:18 +09:00
parent bb0de88f24
commit 8c2f301a41
17 changed files with 38 additions and 41 deletions

View file

@ -15,8 +15,8 @@ use syntax::{algo::ancestors_at_offset, ast, AstNode, TextRange};
// |===
pub(crate) fn interpret_function(db: &RootDatabase, position: FilePosition) -> String {
let start_time = Instant::now();
let mut result = find_and_interpret(db, position)
.unwrap_or_else(|| "Not inside a function body".to_string());
let mut result =
find_and_interpret(db, position).unwrap_or_else(|| "Not inside a function body".to_owned());
let duration = Instant::now() - start_time;
writeln!(result).unwrap();
writeln!(result, "----------------------").unwrap();