about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-31 16:25:28 +0000
committerbors <bors@rust-lang.org>2023-12-31 16:25:28 +0000
commita89eb85d09b5738f5fa2c4ec7dbd621a16454413 (patch)
treeb1006c26e78de7337611c4e418cdc73a01da233f /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parenteca393239515c0a72838eec9477e6689809911c4 (diff)
parentfe35e08e9f96f9c829add20351b2fbf28faac324 (diff)
downloadrust-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/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions