Lint against Rc<String> (and Rc<Vec<T>>) #2623
Labels
A-lint
Area: New lints
good-first-issue
These issues are a good way to get started with Clippy
L-guidelines
Lint: Related to the Rust API Guidelines
L-unnecessary
Lint: Warn about unnecessary code
T-middle
Type: Probably requires verifiying types
Now that it's easy to construct
Rc<str>
andRc<[T]>
usinginto()
, we should advise people to use them.Especially
Rc<String>
is often advised to avoid cloning strings, but has no advantages (except if you want to useget_mut
) and is a) larger, b) has one more pointer to chase, and c) doesn't implementBorrow<str>
.The text was updated successfully, but these errors were encountered: