From d4fb7476efc8bf956c56ba2b0e946f48f38a6efc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 9 Jan 2021 15:18:49 +0300 Subject: Better names --- crates/ide/src/syntax_highlighting/html.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ide/src/syntax_highlighting/html.rs') diff --git a/crates/ide/src/syntax_highlighting/html.rs b/crates/ide/src/syntax_highlighting/html.rs index 44f611b25..0ee7bc96e 100644 --- a/crates/ide/src/syntax_highlighting/html.rs +++ b/crates/ide/src/syntax_highlighting/html.rs @@ -20,26 +20,26 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo ) } - let ranges = highlight(db, file_id, None, false); + let hl_ranges = highlight(db, file_id, None, false); let text = parse.tree().syntax().to_string(); let mut buf = String::new(); buf.push_str(&STYLE); buf.push_str("
");
-    for range in &ranges {
-        let curr = &text[range.range];
-        if range.highlight.is_empty() {
-            format_to!(buf, "{}", html_escape(curr));
+    for r in &hl_ranges {
+        let chunk = html_escape(&text[r.range]);
+        if r.highlight.is_empty() {
+            format_to!(buf, "{}", chunk);
             continue;
         }
 
-        let class = range.highlight.to_string().replace('.', " ");
-        let color = match (rainbow, range.binding_hash) {
+        let class = r.highlight.to_string().replace('.', " ");
+        let color = match (rainbow, r.binding_hash) {
             (true, Some(hash)) => {
                 format!(" data-binding-hash=\"{}\" style=\"color: {};\"", hash, rainbowify(hash))
             }
             _ => "".into(),
         };
-        format_to!(buf, "{}", class, color, html_escape(curr));
+        format_to!(buf, "{}", class, color, chunk);
     }
     buf.push_str("
"); buf -- cgit v1.2.3