From b8c85cc8f443eeb2d674141451e080cf40ac58ec Mon Sep 17 00:00:00 2001 From: Ameer Ghani Date: Wed, 28 Aug 2024 11:53:55 -0500 Subject: [PATCH] docs: Prefer Arc::clone(&arc) instead of arc.clone() (#3380) --- docs/DEVELOPMENT.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index e9ad9c480..e218ee57d 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -125,4 +125,9 @@ To create a new migration: }, ``` +* When using an `Arc`, prefer to write `Arc::clone(&arc)` instead of `arc.clone()`. + This makes it clear that the `Arc` is being cloned (cheap) and not the underlying + data type (possibly expensive). This will also catch any mistakes where you + intended to clone the Arc and not the underlying data. + [hide_env_values]: https://docs.rs/clap/latest/clap/struct.Arg.html#method.hide_env_values