aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/view_hir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/view_hir.rs')
-rw-r--r--crates/ide/src/view_hir.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide/src/view_hir.rs b/crates/ide/src/view_hir.rs
index cfcfb7cfb..f8f3fae3d 100644
--- a/crates/ide/src/view_hir.rs
+++ b/crates/ide/src/view_hir.rs
@@ -11,7 +11,7 @@ use syntax::{algo::find_node_at_offset, ast, AstNode};
11// | VS Code | **Rust Analyzer: View Hir** 11// | VS Code | **Rust Analyzer: View Hir**
12// |=== 12// |===
13pub(crate) fn view_hir(db: &RootDatabase, position: FilePosition) -> String { 13pub(crate) fn view_hir(db: &RootDatabase, position: FilePosition) -> String {
14 body_hir(db, position).unwrap_or("Not inside a function body".to_string()) 14 body_hir(db, position).unwrap_or_else(|| "Not inside a function body".to_string())
15} 15}
16 16
17fn body_hir(db: &RootDatabase, position: FilePosition) -> Option<String> { 17fn body_hir(db: &RootDatabase, position: FilePosition) -> Option<String> {