diff options
| author | Phil Ellison <phil.j.ellison@gmail.com> | 2021-01-03 08:54:33 +0000 |
|---|---|---|
| committer | Phil Ellison <phil.j.ellison@gmail.com> | 2021-01-03 08:54:33 +0000 |
| commit | ee7c3f79e29bf140fe6faaf52bee63dba2fc29b1 (patch) | |
| tree | 45745debcb950ba5422fc73faa42ae6d7255d38f | |
| parent | 609a069757aa071c377c0e02d7b18b4ff7b32631 (diff) | |
| download | rust-ee7c3f79e29bf140fe6faaf52bee63dba2fc29b1.tar.gz rust-ee7c3f79e29bf140fe6faaf52bee63dba2fc29b1.zip | |
Use stdx::format_to instead of writeln
| -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 f68299d3a12..804cdb143f0 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -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}; @@ -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, @@ -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 |
