Function mpd_protocol::command::escape_argument
source · pub fn escape_argument(argument: &str) -> Cow<'_, str>
Expand description
Escape a single argument, prefixing necessary characters (quotes and backslashes) with backslashes.
Returns a borrowed Cow
if the argument did not require escaping.
assert_eq!(escape_argument("foo'bar\""), "foo\\'bar\\\"");