diff options
| author | bors <bors@rust-lang.org> | 2023-12-31 16:25:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-31 16:25:28 +0000 |
| commit | a89eb85d09b5738f5fa2c4ec7dbd621a16454413 (patch) | |
| tree | b1006c26e78de7337611c4e418cdc73a01da233f /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | eca393239515c0a72838eec9477e6689809911c4 (diff) | |
| parent | fe35e08e9f96f9c829add20351b2fbf28faac324 (diff) | |
| download | rust-a89eb85d09b5738f5fa2c4ec7dbd621a16454413.tar.gz rust-a89eb85d09b5738f5fa2c4ec7dbd621a16454413.zip | |
Auto merge of #11987 - torfsen:8733-Suggest-str.lines-when-splitting-at-newlines, r=Jarcho
Issue 8733: Suggest `str.lines` when splitting at hard-coded newlines Fixes #8733. ``` changelog: [`splitting_strings_at_newlines`]: New lint that suggests `str.lines` over splitting at hard-coded newlines ``` This is my first PR to Clippy and one of my first Rust PRs in general -- please feel free to nitpick, I'm thankful for any opportunity to learn! I'd be especially interested in feedback to the following points: * Is checking for `'\n'`, `"\n"`, and `"\r\n"` as arguments to `split` enough, or should we do more (e.g. checking for constants that have those values if that is possible)? * Could the code be written in a more idiomatic way? * Is the default `".."` for `snippet` a good choice? I copied it from other uses of `snippet` in the code base, but I'm not entirely sure. * Is the category `suspicious` a good choice? * Is the suggestion applicability `MaybeIncorrect` a good choice? I used it because the return type of `lines` is not exactly the same as that of `split`.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
