- Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages
Description
Description
Example:
let my_string = String::from("hello"); let eq = my_string == "hello".to_owned();
Why does clippy suggest changing "hello".to_owned()
into *"hello"
instead of "hello"
?
This created confusion for beginners because dereferencing a string literal isn't something you normally do.
Version
rustc 1.58.0-nightly (4961b107f 2021-11-04) binary: rustc commit-hash: 4961b107f204e15b26961eab0685df6be3ab03c6 commit-date: 2021-11-04 host: x86_64-unknown-linux-gnu release: 1.58.0-nightly LLVM version: 13.0.0
Additional Labels
@rustbot label +C-enhancement
BartMassey
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages