From 9af37e4762a571f7a4cbf0c8fc20bfcbd40d8daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Thu, 17 Mar 2022 23:19:05 +0100 Subject: [PATCH] Add comment to quote_token about the tokens order --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 705ac17..5e3d848 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -842,9 +842,9 @@ macro_rules! quote_token_with_context_spanned { } // These rules are ordered by approximate token frequency, at least for the -// first 10 or so, to improve compile times. Having `ident` first is by far the -// most important, because it's typically 2-3x more common than the next most -// common token. +// first 10 or so, to improve compile times. Similarly, having the `$tokens` at +// the end allows for failing rules to fail as quickly as possible, and also helps +// reduce compile times for crates that use `quote!` heavily. #[macro_export] #[doc(hidden)] macro_rules! quote_token {