|
1 | 1 | //! FIXME: write short doc here
|
2 |
| -use std::{fmt::Write, iter, sync::Arc}; |
| 2 | +use std::{iter, sync::Arc}; |
3 | 3 |
|
4 | 4 | use arrayvec::ArrayVec;
|
5 | 5 | use base_db::{CrateDisplayName, CrateId, Edition, FileId};
|
@@ -39,7 +39,7 @@ use hir_ty::{
|
39 | 39 | TyDefId, TyKind, TypeCtor,
|
40 | 40 | };
|
41 | 41 | use rustc_hash::FxHashSet;
|
42 |
| -use stdx::impl_from; |
| 42 | +use stdx::{format_to, impl_from}; |
43 | 43 | use syntax::{
|
44 | 44 | ast::{self, AttrsOwner, NameOwner},
|
45 | 45 | AstNode, SmolStr,
|
@@ -803,9 +803,9 @@ impl Function {
|
803 | 803 | let body = db.body(self.id.into());
|
804 | 804 |
|
805 | 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 | 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 | 811 | result
|
|
0 commit comments