diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-27 14:04:29 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-27 14:04:29 +0100 |
commit | 6f6580dec764e136148f3fe55c203a9452176bdd (patch) | |
tree | 6f0a3cc5f814e66f66044db175f16b0de8256bbc /crates/ide/src/syntax_highlighting | |
parent | e7da5816d67fadc056ee43310f9d04164c2617d9 (diff) | |
parent | 4d0cfc07fd917615a65241ec5e8f05415718f07f (diff) |
Merge #5898
5898: Minor
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r-- | crates/ide/src/syntax_highlighting/html.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/html.rs b/crates/ide/src/syntax_highlighting/html.rs index 249368ff8..57e2d2923 100644 --- a/crates/ide/src/syntax_highlighting/html.rs +++ b/crates/ide/src/syntax_highlighting/html.rs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | use base_db::SourceDatabase; | 3 | use base_db::SourceDatabase; |
4 | use oorandom::Rand32; | 4 | use oorandom::Rand32; |
5 | use stdx::format_to; | ||
5 | use syntax::{AstNode, TextRange, TextSize}; | 6 | use syntax::{AstNode, TextRange, TextSize}; |
6 | 7 | ||
7 | use crate::{syntax_highlighting::highlight, FileId, RootDatabase}; | 8 | use crate::{syntax_highlighting::highlight, FileId, RootDatabase}; |
@@ -40,7 +41,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo | |||
40 | } | 41 | } |
41 | _ => "".into(), | 42 | _ => "".into(), |
42 | }; | 43 | }; |
43 | buf.push_str(&format!("<span class=\"{}\"{}>{}</span>", class, color, html_escape(curr))); | 44 | format_to!(buf, "<span class=\"{}\"{}>{}</span>", class, color, html_escape(curr)); |
44 | 45 | ||
45 | prev_pos = range.range.end(); | 46 | prev_pos = range.range.end(); |
46 | } | 47 | } |