Clippy lint: single-character string constant

This commit is contained in:
Alan Du 2018-10-16 11:45:10 -04:00
parent 4dbf0379cc
commit 5db663d61f
4 changed files with 5 additions and 5 deletions

View File

@ -388,7 +388,7 @@ impl AnalysisImpl {
.text() .text()
.slice(range_search) .slice(range_search)
.to_string() .to_string()
.matches(",") .matches(',')
.count(); .count();
// If we have a method call eat the first param since it's just self. // If we have a method call eat the first param since it's just self.

View File

@ -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 prefix = TextRange::from_to(ws.range().start(), offset) - ws.range().start();
let ws_suffix = &ws_text.as_str()[suffix]; let ws_suffix = &ws_text.as_str()[suffix];
let ws_prefix = &ws_text.as_str()[prefix]; 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() { if let Some(node) = ws.next_sibling() {
let start = match ws_prefix.rfind('\n') { let start = match ws_prefix.rfind('\n') {
Some(idx) => ws.range().start() + TextUnit::from((idx + 1) as u32), Some(idx) => ws.range().start() + TextUnit::from((idx + 1) as u32),

View File

@ -160,8 +160,8 @@ pub fn handle_workspace_symbol(
params: req::WorkspaceSymbolParams, params: req::WorkspaceSymbolParams,
token: JobToken, token: JobToken,
) -> Result<Option<Vec<SymbolInformation>>> { ) -> Result<Option<Vec<SymbolInformation>>> {
let all_symbols = params.query.contains("#"); let all_symbols = params.query.contains('#');
let libs = params.query.contains("*"); let libs = params.query.contains('*');
let query = { let query = {
let query: String = params let query: String = params
.query .query

View File

@ -50,7 +50,7 @@ pub fn collect_tests(s: &str) -> Vec<(usize, Test)> {
block.map(|(_, line)| line).chain(::std::iter::once("")), block.map(|(_, line)| line).chain(::std::iter::once("")),
"\n", "\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.push((start_line, Test { name, text }))
} }
res res