aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-10-23 11:08:55 +0100
committerJonas Schievink <[email protected]>2020-10-23 11:12:03 +0100
commitbfe1efca26a9ae07d44ca3cc79ffdc4342f72b44 (patch)
treecc0b86ea46b1196a9b001c34621b5bab3a05d834 /crates/hir_def
parentdbd6266bc91c3934176e251eedb7de381fcc1006 (diff)
Use format_to
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/diagnostics.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir_def/src/diagnostics.rs b/crates/hir_def/src/diagnostics.rs
index 34a6a8d4b..532496b62 100644
--- a/crates/hir_def/src/diagnostics.rs
+++ b/crates/hir_def/src/diagnostics.rs
@@ -1,13 +1,12 @@
1//! Diagnostics produced by `hir_def`. 1//! Diagnostics produced by `hir_def`.
2 2
3use std::any::Any; 3use std::any::Any;
4use std::fmt::Write; 4use stdx::format_to;
5 5
6use cfg::{CfgExpr, CfgOptions, DnfExpr}; 6use cfg::{CfgExpr, CfgOptions, DnfExpr};
7use hir_expand::diagnostics::{Diagnostic, DiagnosticCode}; 7use hir_expand::diagnostics::{Diagnostic, DiagnosticCode};
8use syntax::{ast, AstPtr, SyntaxNodePtr};
9
10use hir_expand::{HirFileId, InFile}; 8use hir_expand::{HirFileId, InFile};
9use syntax::{ast, AstPtr, SyntaxNodePtr};
11 10
12// Diagnostic: unresolved-module 11// Diagnostic: unresolved-module
13// 12//
@@ -109,7 +108,7 @@ impl Diagnostic for InactiveCode {
109 let mut buf = "code is inactive due to #[cfg] directives".to_string(); 108 let mut buf = "code is inactive due to #[cfg] directives".to_string();
110 109
111 if let Some(inactive) = inactive { 110 if let Some(inactive) = inactive {
112 write!(buf, ": {}", inactive).unwrap(); 111 format_to!(buf, ": {}", inactive);
113 } 112 }
114 113
115 buf 114 buf