Skip to content

Commit ee7c3f7

Browse files
committed
Use stdx::format_to instead of writeln
1 parent 609a069 commit ee7c3f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/hir/src/code_model.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! FIXME: write short doc here
2-
use std::{fmt::Write, iter, sync::Arc};
2+
use std::{iter, sync::Arc};
33

44
use arrayvec::ArrayVec;
55
use base_db::{CrateDisplayName, CrateId, Edition, FileId};
@@ -39,7 +39,7 @@ use hir_ty::{
3939
TyDefId, TyKind, TypeCtor,
4040
};
4141
use rustc_hash::FxHashSet;
42-
use stdx::impl_from;
42+
use stdx::{format_to, impl_from};
4343
use syntax::{
4444
ast::{self, AttrsOwner, NameOwner},
4545
AstNode, SmolStr,
@@ -803,9 +803,9 @@ impl Function {
803803
let body = db.body(self.id.into());
804804

805805
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));
807807
for (id, expr) in body.exprs.iter() {
808-
writeln!(&mut result, "{:?}: {:?}", id, expr).unwrap();
808+
format_to!(result, "{:?}: {:?}\n", id, expr);
809809
}
810810

811811
result

0 commit comments

Comments
 (0)