From 6596e7cddfc00281362c3640781f6cd6bc0b5614 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 28 Mar 2020 11:08:19 +0100 Subject: Nice string formatting --- crates/ra_hir_ty/src/test_db.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_ty/src') diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index 5bbeabf51..208096aab 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs @@ -10,6 +10,7 @@ use hir_expand::{db::AstDatabase, diagnostics::DiagnosticSink}; use ra_db::{ salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, RelativePath, SourceDatabase, Upcast, }; +use stdx::format_to; use crate::{db::HirDatabase, expr::ExprValidator}; @@ -131,7 +132,7 @@ impl TestDB { for f in fns { let infer = self.infer(f.into()); let mut sink = DiagnosticSink::new(|d| { - buf += &format!("{:?}: {}\n", d.syntax_node(self).text(), d.message()); + format_to!(buf, "{:?}: {}\n", d.syntax_node(self).text(), d.message()); }); infer.add_diagnostics(self, f, &mut sink); let mut validator = ExprValidator::new(f, infer, &mut sink); -- cgit v1.2.3