mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
use strip_prefix() instead of starts_with and slicing (clippy::manual_strip)
This commit is contained in:
parent
3d9b3a8575
commit
8a67116857
4 changed files with 9 additions and 13 deletions
|
@ -333,8 +333,7 @@ impl ast::Use {
|
|||
.and_then(ast::Whitespace::cast);
|
||||
if let Some(next_ws) = next_ws {
|
||||
let ws_text = next_ws.syntax().text();
|
||||
if ws_text.starts_with('\n') {
|
||||
let rest = &ws_text[1..];
|
||||
if let Some(rest) = ws_text.strip_prefix('\n') {
|
||||
if rest.is_empty() {
|
||||
res.delete(next_ws.syntax())
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue