aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-12-20 20:14:30 +0000
committerkjeremy <[email protected]>2019-12-20 20:14:30 +0000
commit0d5d63a80ea08f2af439bcc72fff9b24d144c70d (patch)
tree688102f3cfdec260f5164d60f0bb95e33ebe9674 /crates/ra_ide/src/completion
parent9467f81c588bf7a62ec882f293e0870c187b368b (diff)
Clippy lints
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