diff options
-rw-r--r-- | crates/hir_def/src/diagnostics.rs | 7 |
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 | ||
3 | use std::any::Any; | 3 | use std::any::Any; |
4 | use std::fmt::Write; | 4 | use stdx::format_to; |
5 | 5 | ||
6 | use cfg::{CfgExpr, CfgOptions, DnfExpr}; | 6 | use cfg::{CfgExpr, CfgOptions, DnfExpr}; |
7 | use hir_expand::diagnostics::{Diagnostic, DiagnosticCode}; | 7 | use hir_expand::diagnostics::{Diagnostic, DiagnosticCode}; |
8 | use syntax::{ast, AstPtr, SyntaxNodePtr}; | ||
9 | |||
10 | use hir_expand::{HirFileId, InFile}; | 8 | use hir_expand::{HirFileId, InFile}; |
9 | use 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 |