From 5db663d61fb8b006e3b84ef3bcc9cddbe94e5f49 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Tue, 16 Oct 2018 11:45:10 -0400 Subject: Clippy lint: single-character string constant --- crates/ra_analysis/src/imp.rs | 2 +- crates/ra_editor/src/extend_selection.rs | 2 +- crates/ra_lsp_server/src/main_loop/handlers.rs | 4 ++-- crates/tools/src/lib.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index f1403cb5d..9b0d935af 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -388,7 +388,7 @@ impl AnalysisImpl { .text() .slice(range_search) .to_string() - .matches(",") + .matches(',') .count(); // If we have a method call eat the first param since it's just self. diff --git a/crates/ra_editor/src/extend_selection.rs b/crates/ra_editor/src/extend_selection.rs index 9ee1df281..9d8df25c3 100644 --- a/crates/ra_editor/src/extend_selection.rs +++ b/crates/ra_editor/src/extend_selection.rs @@ -63,7 +63,7 @@ fn extend_ws(root: SyntaxNodeRef, ws: SyntaxNodeRef, offset: TextUnit) -> TextRa let prefix = TextRange::from_to(ws.range().start(), offset) - ws.range().start(); let ws_suffix = &ws_text.as_str()[suffix]; let ws_prefix = &ws_text.as_str()[prefix]; - if ws_text.contains("\n") && !ws_suffix.contains("\n") { + if ws_text.contains('\n') && !ws_suffix.contains('\n') { if let Some(node) = ws.next_sibling() { let start = match ws_prefix.rfind('\n') { Some(idx) => ws.range().start() + TextUnit::from((idx + 1) as u32), diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index c25b63852..49bd7895a 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -160,8 +160,8 @@ pub fn handle_workspace_symbol( params: req::WorkspaceSymbolParams, token: JobToken, ) -> Result>> { - let all_symbols = params.query.contains("#"); - let libs = params.query.contains("*"); + let all_symbols = params.query.contains('#'); + let libs = params.query.contains('*'); let query = { let query: String = params .query diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 444745be5..7c5410d3c 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -50,7 +50,7 @@ pub fn collect_tests(s: &str) -> Vec<(usize, Test)> { block.map(|(_, line)| line).chain(::std::iter::once("")), "\n", ); - assert!(!text.trim().is_empty() && text.ends_with("\n")); + assert!(!text.trim().is_empty() && text.ends_with('\n')); res.push((start_line, Test { name, text })) } res -- cgit v1.2.3