diff options
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index f68299d3a..804cdb143 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | use std::{fmt::Write, iter, sync::Arc}; | 2 | use std::{iter, sync::Arc}; |
3 | 3 | ||
4 | use arrayvec::ArrayVec; | 4 | use arrayvec::ArrayVec; |
5 | use base_db::{CrateDisplayName, CrateId, Edition, FileId}; | 5 | use base_db::{CrateDisplayName, CrateId, Edition, FileId}; |
@@ -39,7 +39,7 @@ use hir_ty::{ | |||
39 | TyDefId, TyKind, TypeCtor, | 39 | TyDefId, TyKind, TypeCtor, |
40 | }; | 40 | }; |
41 | use rustc_hash::FxHashSet; | 41 | use rustc_hash::FxHashSet; |
42 | use stdx::impl_from; | 42 | use stdx::{format_to, impl_from}; |
43 | use syntax::{ | 43 | use syntax::{ |
44 | ast::{self, AttrsOwner, NameOwner}, | 44 | ast::{self, AttrsOwner, NameOwner}, |
45 | AstNode, SmolStr, | 45 | AstNode, SmolStr, |
@@ -803,9 +803,9 @@ impl Function { | |||
803 | let body = db.body(self.id.into()); | 803 | let body = db.body(self.id.into()); |
804 | 804 | ||
805 | let mut result = String::new(); | 805 | let mut result = String::new(); |
806 | writeln!(&mut result, "HIR expressions in the body of `{}`:", self.name(db)).unwrap(); | 806 | format_to!(result, "HIR expressions in the body of `{}`:\n", self.name(db)); |
807 | for (id, expr) in body.exprs.iter() { | 807 | for (id, expr) in body.exprs.iter() { |
808 | writeln!(&mut result, "{:?}: {:?}", id, expr).unwrap(); | 808 | format_to!(result, "{:?}: {:?}\n", id, expr); |
809 | } | 809 | } |
810 | 810 | ||
811 | result | 811 | result |