match on chars instead of &strs for .split() or .strip_prefix()

This commit is contained in:
Matthias Krüger
2023-07-23 10:12:40 +02:00
parent cec34a43b1
commit 7a7708904b
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ fn str_to_cdata(s: &str) -> String {
let escaped_output = s.replace("]]>", "]]]]><![CDATA[>");
let escaped_output = escaped_output.replace("<?", "<]]><![CDATA[?");
// We also smuggle newlines as &#xa so as to keep all the output on one line
let escaped_output = escaped_output.replace("\n", "]]>&#xA;<![CDATA[");
let escaped_output = escaped_output.replace('\n', "]]>&#xA;<![CDATA[");
// Prune empty CDATA blocks resulting from any escaping
let escaped_output = escaped_output.replace("<![CDATA[]]>", "");
format!("<![CDATA[{}]]>", escaped_output)