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()
.slice(range_search)
.to_string()
.matches(",")
.matches(',')
.count();
// 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 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),

View file

@ -160,8 +160,8 @@ pub fn handle_workspace_symbol(
params: req::WorkspaceSymbolParams,
token: JobToken,
) -> Result<Option<Vec<SymbolInformation>>> {
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

View file

@ -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