Skip to content

Lint against Rc<String> (and Rc<Vec<T>>) #2623

Closed
@birkenfeld

Description

@birkenfeld

Now that it's easy to construct Rc<str> and Rc<[T]> using into(), 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 use get_mut) and is a) larger, b) has one more pointer to chase, and c) doesn't implement Borrow<str>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-guidelinesLint: Related to the Rust API GuidelinesL-unnecessaryLint: Warn about unnecessary codeT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions