From 6b9347abcb64dc919b6d5b9636461de8bd3ef0da Mon Sep 17 00:00:00 2001 From: Hocuri Date: Thu, 9 Jul 2026 14:11:37 +0200 Subject: [PATCH] docs: Update STYLE.md: macros should be used only when necessary Add guidelines on using macros in Rust for clarity. --- STYLE.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/STYLE.md b/STYLE.md index 6b47eaa7c8..9602407fb6 100644 --- a/STYLE.md +++ b/STYLE.md @@ -181,3 +181,10 @@ Calling `into()`, `try_into()` or `parse()` creates an indirection, which is hard to follow for people who are not familiar with Rust, or who are not using rust-analyzer. + +## Use macros only when really needed + +Macros can be hard to read for people unfamiliar with Rust, +and can have surprising effects like evaluating arguments multiple times. +Therefore, macros should only be used when really needed; +using functions is usually better.