Skip to content

Commit

Permalink
docs: Prefer Arc::clone(&arc) instead of arc.clone() (#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
inahga authored Aug 28, 2024
1 parent 38a671d commit b8c85cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b8c85cc

Please sign in to comment.