unquote

Function unquote 

Source
pub fn unquote(pot_quoted: &str) -> &str
Expand description

Returns an unquoted version of the input string, or the input string its self, if it was not quoted in the first place.

assert_eq!(unquote(r#""Hello World""#), r#"Hello World"#);
assert_eq!(unquote(r#" "Hello World" "#), r#" "Hello World" "#);
assert_eq!(unquote(r#" "Hello World""#), r#" "Hello World""#);
assert_eq!(unquote(r#""Hello World" "#), r#""Hello World" "#);
assert_eq!(unquote(r#""Hello World"#), r#""Hello World"#);
assert_eq!(unquote(r#"Hello World""#), r#"Hello World""#);
assert_eq!(unquote(r#"'Hello World'"#), r#"Hello World"#);
assert_eq!(unquote(r#" 'Hello World' "#), r#" 'Hello World' "#);
assert_eq!(unquote(r#" 'Hello World'"#), r#" 'Hello World'"#);
assert_eq!(unquote(r#"'Hello World' "#), r#"'Hello World' "#);
assert_eq!(unquote(r#"'Hello World"#), r#"'Hello World"#);
assert_eq!(unquote(r#"Hello World'"#), r#"Hello World'"#);
assert_eq!(unquote(r#"Hello World"#), r#"Hello World"#);
assert_eq!(unquote(r#""Hello World'"#), r#""Hello World'"#);
assert_eq!(unquote(r#"'Hello World""#), r#"'Hello World""#);