Skip to main content

xml_escape

Function xml_escape 

Source
fn xml_escape(s: &str) -> String
Expand description

Minimal XML text escaping for the two generated XML documents.

Only the five predefined entities matter here, and the only untrusted-ish input is a filesystem path (which can legitimately contain & and, on Unix, </>/quotes). Hand-rolled rather than pulling an XML crate into a binary the codebase deliberately keeps tiny — the same reasoning second_instance.rs gives for hand-rolling its HTTP request.