]> git.lizzy.rs Git - rust.git/commitdiff
Minor
authorAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 27 Aug 2020 13:02:56 +0000 (15:02 +0200)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 27 Aug 2020 13:02:56 +0000 (15:02 +0200)
crates/ide/src/syntax_highlighting/html.rs

index 249368ff8142a3670197a40e2e9181cef25072b5..57e2d292312614767f9bb4e90178fc4fa6846034 100644 (file)
@@ -2,6 +2,7 @@
 
 use base_db::SourceDatabase;
 use oorandom::Rand32;
+use stdx::format_to;
 use syntax::{AstNode, TextRange, TextSize};
 
 use crate::{syntax_highlighting::highlight, FileId, RootDatabase};
@@ -40,7 +41,7 @@ fn rainbowify(seed: u64) -> String {
             }
             _ => "".into(),
         };
-        buf.push_str(&format!("<span class=\"{}\"{}>{}</span>", class, color, html_escape(curr)));
+        format_to!(buf, "<span class=\"{}\"{}>{}</span>", class, color, html_escape(curr));
 
         prev_pos = range.range.end();
     }