aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-21 06:12:36 +0000
committerGitHub <[email protected]>2019-12-21 06:12:36 +0000
commit1cbef27ff857803fbee123e6730b83e1ef154f6c (patch)
tree7d45ce377fb8f4c7019bb74381228b94f397110f /crates/ra_ide/src/completion
parent6eab968c601637361e8fbd1ee93ded1b0d967bee (diff)
parent0d5d63a80ea08f2af439bcc72fff9b24d144c70d (diff)
Merge #2625
2625: Clippy lints r=matklad a=kjeremy Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r--crates/ra_ide/src/completion/complete_postfix.rs2
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs17
2 files changed, 9 insertions, 10 deletions
diff --git a/crates/ra_ide/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs
index 646a30c76..5470dc291 100644
--- a/crates/ra_ide/src/completion/complete_postfix.rs
+++ b/crates/ra_ide/src/completion/complete_postfix.rs
@@ -12,7 +12,7 @@ use crate::{
12}; 12};
13 13
14pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { 14pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
15 if ctx.db.feature_flags.get("completion.enable-postfix") == false { 15 if !ctx.db.feature_flags.get("completion.enable-postfix") {
16 return; 16 return;
17 } 17 }
18 18
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index 981da2b79..4894ea2f6 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -239,16 +239,15 @@ impl<'a> CompletionContext<'a> {
239 .expr() 239 .expr()
240 .map(|e| e.syntax().text_range()) 240 .map(|e| e.syntax().text_range())
241 .and_then(|r| find_node_with_range(original_file.syntax(), r)); 241 .and_then(|r| find_node_with_range(original_file.syntax(), r));
242 self.dot_receiver_is_ambiguous_float_literal = if let Some(ast::Expr::Literal(l)) = 242 self.dot_receiver_is_ambiguous_float_literal =
243 &self.dot_receiver 243 if let Some(ast::Expr::Literal(l)) = &self.dot_receiver {
244 { 244 match l.kind() {
245 match l.kind() { 245 ast::LiteralKind::FloatNumber { .. } => l.token().text().ends_with('.'),
246 ast::LiteralKind::FloatNumber { suffix: _ } => l.token().text().ends_with('.'), 246 _ => false,
247 _ => false, 247 }
248 } else {
249 false
248 } 250 }
249 } else {
250 false
251 }
252 } 251 }
253 if let Some(method_call_expr) = ast::MethodCallExpr::cast(parent) { 252 if let Some(method_call_expr) = ast::MethodCallExpr::cast(parent) {
254 // As above 253 // As above