[][src]Function azul_css_parser::strip_quotes

pub fn strip_quotes<'a>(
    input: &'a str
) -> Result<QuoteStripped<'a>, UnclosedQuotesError<'a>>

Strip quotes from an input, given that both quotes use either " or ', but not both.

Example

assert_eq!(strip_quotes("\"Helvetica\""), Ok(QuoteStripped("Helvetica")));
assert_eq!(strip_quotes("'Arial'"), Ok(QuoteStripped("Arial")));
assert_eq!(strip_quotes("\"Arial'"), Err(UnclosedQuotesError("\"Arial'")));