From 82d6cfd495c7e0f230ce1ac61e7a4297fa22f02f Mon Sep 17 00:00:00 2001 From: kjeremy Date: Wed, 30 Sep 2020 15:22:49 -0400 Subject: Minor clippy performance suggestions --- crates/syntax/src/ast/edit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/syntax') diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs index dda0a0319..77233ab31 100644 --- a/crates/syntax/src/ast/edit.rs +++ b/crates/syntax/src/ast/edit.rs @@ -159,7 +159,7 @@ impl ast::AssocItemList { let whitespace = last_token_before_curly.clone().into_token().and_then(ast::Whitespace::cast)?; let text = whitespace.syntax().text(); - let newline = text.rfind("\n")?; + let newline = text.rfind('\n')?; let keep = tokens::WsBuilder::new(&text[newline..]); Some(self.replace_children( first_token_after_items..=last_token_before_curly, -- cgit v1.2.3