diff options
author | Jonas Schievink <[email protected]> | 2020-10-23 11:08:55 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-10-23 11:12:03 +0100 |
commit | bfe1efca26a9ae07d44ca3cc79ffdc4342f72b44 (patch) | |
tree | cc0b86ea46b1196a9b001c34621b5bab3a05d834 /crates/hir_def | |
parent | dbd6266bc91c3934176e251eedb7de381fcc1006 (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.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 |