mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Fix a few clippy::perf warnings
This commit is contained in:
parent
cc49502ab4
commit
f9bb398cc5
8 changed files with 14 additions and 12 deletions
|
@ -11,7 +11,7 @@ use syntax::{algo::find_node_at_offset, ast, AstNode};
|
|||
// | VS Code | **Rust Analyzer: View Hir**
|
||||
// |===
|
||||
pub(crate) fn view_hir(db: &RootDatabase, position: FilePosition) -> String {
|
||||
body_hir(db, position).unwrap_or("Not inside a function body".to_string())
|
||||
body_hir(db, position).unwrap_or_else(|| "Not inside a function body".to_string())
|
||||
}
|
||||
|
||||
fn body_hir(db: &RootDatabase, position: FilePosition) -> Option<String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue