mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
Use format_to
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
parent
dbd6266bc9
commit
bfe1efca26
1 changed files with 3 additions and 4 deletions
|
@ -1,13 +1,12 @@
|
|||
//! Diagnostics produced by `hir_def`.
|
||||
|
||||
use std::any::Any;
|
||||
use std::fmt::Write;
|
||||
use stdx::format_to;
|
||||
|
||||
use cfg::{CfgExpr, CfgOptions, DnfExpr};
|
||||
use hir_expand::diagnostics::{Diagnostic, DiagnosticCode};
|
||||
use syntax::{ast, AstPtr, SyntaxNodePtr};
|
||||
|
||||
use hir_expand::{HirFileId, InFile};
|
||||
use syntax::{ast, AstPtr, SyntaxNodePtr};
|
||||
|
||||
// Diagnostic: unresolved-module
|
||||
//
|
||||
|
@ -109,7 +108,7 @@ impl Diagnostic for InactiveCode {
|
|||
let mut buf = "code is inactive due to #[cfg] directives".to_string();
|
||||
|
||||
if let Some(inactive) = inactive {
|
||||
write!(buf, ": {}", inactive).unwrap();
|
||||
format_to!(buf, ": {}", inactive);
|
||||
}
|
||||
|
||||
buf
|
||||
|
|
Loading…
Reference in a new issue