Parse the provided quoted string. This function was adopted from [snailquote](https://docs.rs/snailquote/latest/snailquote/). # Details Parses a single or double quoted string and interprets escape sequences such as '\n', '\r', '\'', etc. Supports raw strings prefixed with `r` or `R` in which case all escape sequences are ignored./// The full set of supported escapes between quotes may be foun
(s: &str)
| 175 | /// The returned result can display a human readable error if the string cannot be parsed as a |
| 176 | /// valid quoted string. |
| 177 | pub fn parse_string(s: &str) -> Result<String, ParseSequenceError> { |
| 178 | let mut chars = s.chars().enumerate(); |
| 179 | let res = String::with_capacity(s.len()); |
| 180 | |
| 181 | match chars.next() { |
| 182 | Some((_, c)) if c == 'r' || c == 'R' => parse_raw_string(&mut chars, res), |
| 183 | Some((_, c)) if c == '\'' || c == '"' => parse_quoted_string(s, &mut chars, res, c), |
| 184 | _ => Err(ParseSequenceError::MissingOpeningQuote), |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | fn parse_raw_string( |
| 189 | chars: &mut Enumerate<Chars>, |