From 870bacee7b029f9a3bb10fa96d0123d19d21e659 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sun, 29 Sep 2024 06:23:03 -0400 Subject: [PATCH] Add a note discouraging new use of `dialect_of` macro --- src/dialect/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dialect/mod.rs b/src/dialect/mod.rs index 619b54713..90dffe82d 100644 --- a/src/dialect/mod.rs +++ b/src/dialect/mod.rs @@ -60,6 +60,13 @@ use alloc::boxed::Box; /// Convenience check if a [`Parser`] uses a certain dialect. /// +/// Note: when possible please the new style, adding a method to the [`Dialect`] +/// trait rather than using this macro. +/// +/// The benefits of adding a method on `Dialect` over this macro are: +/// 1. user defined [`Dialect`]s can customize the parsing behavior +/// 2. The differences between dialects can be clearly documented in the trait +/// /// `dialect_of!(parser Is SQLiteDialect | GenericDialect)` evaluates /// to `true` if `parser.dialect` is one of the [`Dialect`]s specified. macro_rules! dialect_of {