Skip to content

Commit

Permalink
Use stdx::format_to instead of writeln
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherphil committed Jan 3, 2021
1 parent 609a069 commit ee7c3f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/hir/src/code_model.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! FIXME: write short doc here
use std::{fmt::Write, iter, sync::Arc};
use std::{iter, sync::Arc};

use arrayvec::ArrayVec;
use base_db::{CrateDisplayName, CrateId, Edition, FileId};
Expand Down Expand Up @@ -39,7 +39,7 @@ use hir_ty::{
TyDefId, TyKind, TypeCtor,
};
use rustc_hash::FxHashSet;
use stdx::impl_from;
use stdx::{format_to, impl_from};
use syntax::{
ast::{self, AttrsOwner, NameOwner},
AstNode, SmolStr,
Expand Down Expand Up @@ -803,9 +803,9 @@ impl Function {
let body = db.body(self.id.into());

let mut result = String::new();
writeln!(&mut result, "HIR expressions in the body of `{}`:", self.name(db)).unwrap();
format_to!(result, "HIR expressions in the body of `{}`:\n", self.name(db));
for (id, expr) in body.exprs.iter() {
writeln!(&mut result, "{:?}: {:?}", id, expr).unwrap();
format_to!(result, "{:?}: {:?}\n", id, expr);
}

result
Expand Down

0 comments on commit ee7c3f7

Please sign in to comment.