Expand description
§merge-whitespace
This crate contains procedural macros for removing multiple consecutive whitespaces from a given string literal, replacing them with a single space.
§Example
const QUERY: &str = merge_whitespace!(r#"
query {
users (limit: 1, filter: "bought a 12\" vinyl
named \"spaces in space \"") {
id
name
todos(order_by: {created_at: desc}, limit: 5) {
id
title
}
}
}
"#,
quote_char = '"',
escape_char = '\\');
assert_eq!(QUERY, r#"query { users (limit: 1, filter: "bought a 12\" vinyl
named \"spaces in space \"") { id name todos(order_by: {created_at: desc}, limit: 5) { id title } } }"#);
Macros§
- merge_
whitespace - This is a procedural macro that removes multiple consecutive whitespaces from a given string literal and replaces them with a single space. Quoted text will be ignored and kept as-is.