Skip to main content

escape_yaml

Function escape_yaml 

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

Escape a string for safe use as a YAML scalar value.

Wraps the string in double quotes if it contains any characters that could be misinterpreted by a YAML parser. Returns the original string if no escaping is needed.