about summary refs log tree commit diff
path: root/src/librustdoc/html/render/cache.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-15 10:56:58 +0100
committerGitHub <noreply@github.com>2021-12-15 10:56:58 +0100
commit9ca0bd518ac5b30eea0319c92566eaf77f397708 (patch)
tree5f7e8958b9da0f98907c85af2976e80350ec7e6a /src/librustdoc/html/render/cache.rs
parentdf89fd2063aaa060c72c81254db0b930ff379e9a (diff)
parent97e844a032c47d4b3e70d2043f809767e437ac24 (diff)
downloadrust-9ca0bd518ac5b30eea0319c92566eaf77f397708.tar.gz
rust-9ca0bd518ac5b30eea0319c92566eaf77f397708.zip
Rollup merge of #91880 - matthiaskrgr:clippy_perf_dec, r=jyn514
fix clippy::single_char_pattern perf findings
Diffstat (limited to 'src/librustdoc/html/render/cache.rs')
-rw-r--r--src/librustdoc/html/render/cache.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs
index 2f7214e958e..631eacc9618 100644
--- a/src/librustdoc/html/render/cache.rs
+++ b/src/librustdoc/html/render/cache.rs
@@ -184,8 +184,8 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
         })
         .expect("failed serde conversion")
         // All these `replace` calls are because we have to go through JS string for JSON content.
-        .replace(r"\", r"\\")
-        .replace("'", r"\'")
+        .replace(r#"\"#, r"\\")
+        .replace(r#"'"#, r"\'")
         // We need to escape double quotes for the JSON.
         .replace("\\\"", "\\\\\"")
     )