Function quoted_string::unquote_unchecked [] [src]

pub fn unquote_unchecked<'a>(quoted: &'a str) -> Cow<'a, str>

undoes quoting of given input assuming it is a valid quoted-string

Example

let unquoted = unquote_unchecked(r#""simple""#);
assert_eq!(unquoted, Cow::Borrowed("simple"));

let unquoted = unquote_unchecked(r#""needs quoting""#);
assert_eq!(unquoted, Cow::Borrowed("needs quoting"));

let unquoted = unquote_unchecked(r#""less\"simple""#);
assert_eq!(unquoted, Cow::Borrowed(r#"less"simple"#));