Crate merge_whitespace

source ·
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) {
                    id
                    name
                    todos(order_by: {created_at: desc}, limit: 5) {
                      id
                      title
                    }
                  }
                }
                "#);

assert_eq!(QUERY, "query { users (limit: 1) { id name todos(order_by: {created_at: desc}, limit: 5) { id title } } }");

Macros§

  • This is a procedural macro that removes multiple consecutive whitespaces from a given string literal and replaces them with a single space.