diff options
author | Alan Du <[email protected]> | 2018-10-16 16:45:10 +0100 |
---|---|---|
committer | Alan Du <[email protected]> | 2018-10-18 00:42:23 +0100 |
commit | 5db663d61fb8b006e3b84ef3bcc9cddbe94e5f49 (patch) | |
tree | b4b904c3580f975bc69f1f68ff938fe70da11bfa /crates | |
parent | 4dbf0379ccd5c7643d48658f0ecc224add5a5c5c (diff) |
Clippy lint: single-character string constant
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 2 | ||||
-rw-r--r-- | crates/ra_editor/src/extend_selection.rs | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 4 | ||||
-rw-r--r-- | 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 { | |||
388 | .text() | 388 | .text() |
389 | .slice(range_search) | 389 | .slice(range_search) |
390 | .to_string() | 390 | .to_string() |
391 | .matches(",") | 391 | .matches(',') |
392 | .count(); | 392 | .count(); |
393 | 393 | ||
394 | // If we have a method call eat the first param since it's just self. | 394 | // 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 | |||
63 | let prefix = TextRange::from_to(ws.range().start(), offset) - ws.range().start(); | 63 | let prefix = TextRange::from_to(ws.range().start(), offset) - ws.range().start(); |
64 | let ws_suffix = &ws_text.as_str()[suffix]; | 64 | let ws_suffix = &ws_text.as_str()[suffix]; |
65 | let ws_prefix = &ws_text.as_str()[prefix]; | 65 | let ws_prefix = &ws_text.as_str()[prefix]; |
66 | if ws_text.contains("\n") && !ws_suffix.contains("\n") { | 66 | if ws_text.contains('\n') && !ws_suffix.contains('\n') { |
67 | if let Some(node) = ws.next_sibling() { | 67 | if let Some(node) = ws.next_sibling() { |
68 | let start = match ws_prefix.rfind('\n') { | 68 | let start = match ws_prefix.rfind('\n') { |
69 | Some(idx) => ws.range().start() + TextUnit::from((idx + 1) as u32), | 69 | 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( | |||
160 | params: req::WorkspaceSymbolParams, | 160 | params: req::WorkspaceSymbolParams, |
161 | token: JobToken, | 161 | token: JobToken, |
162 | ) -> Result<Option<Vec<SymbolInformation>>> { | 162 | ) -> Result<Option<Vec<SymbolInformation>>> { |
163 | let all_symbols = params.query.contains("#"); | 163 | let all_symbols = params.query.contains('#'); |
164 | let libs = params.query.contains("*"); | 164 | let libs = params.query.contains('*'); |
165 | let query = { | 165 | let query = { |
166 | let query: String = params | 166 | let query: String = params |
167 | .query | 167 | .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)> { | |||
50 | block.map(|(_, line)| line).chain(::std::iter::once("")), | 50 | block.map(|(_, line)| line).chain(::std::iter::once("")), |
51 | "\n", | 51 | "\n", |
52 | ); | 52 | ); |
53 | assert!(!text.trim().is_empty() && text.ends_with("\n")); | 53 | assert!(!text.trim().is_empty() && text.ends_with('\n')); |
54 | res.push((start_line, Test { name, text })) | 54 | res.push((start_line, Test { name, text })) |
55 | } | 55 | } |
56 | res | 56 | res |