From ce2686a16997c17fd7729e378e21cc463d2e97d4 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 30 Sep 2024 07:08:13 -0400 Subject: [PATCH] Add a note discouraging new use of `dialect_of` macro (#1448) --- src/dialect/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dialect/mod.rs b/src/dialect/mod.rs index 619b5471..90dffe82 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 {