diff options
author | kjeremy <[email protected]> | 2020-01-13 16:38:53 +0000 |
---|---|---|
committer | kjeremy <[email protected]> | 2020-01-13 16:38:53 +0000 |
commit | c5c5f4260b4ab1a03d2d3f7a616202369adc9ade (patch) | |
tree | 4ef3658ab7cd5b865fbc5c9e96795719bc87ead8 /crates/ra_ide/src | |
parent | a82c679c97af1e0aabe9eb375573d5d23fc75391 (diff) |
Readability
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r-- | crates/ra_ide/src/call_info.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide/src/call_info.rs b/crates/ra_ide/src/call_info.rs index 14f5ead6b..72a68522e 100644 --- a/crates/ra_ide/src/call_info.rs +++ b/crates/ra_ide/src/call_info.rs | |||
@@ -4,7 +4,7 @@ use ra_syntax::{ | |||
4 | ast::{self, ArgListOwner}, | 4 | ast::{self, ArgListOwner}, |
5 | match_ast, AstNode, SyntaxNode, | 5 | match_ast, AstNode, SyntaxNode, |
6 | }; | 6 | }; |
7 | use std::cmp::Ordering; | 7 | |
8 | use test_utils::tested_by; | 8 | use test_utils::tested_by; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
@@ -51,14 +51,14 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option<Cal | |||
51 | // If we have a calling expression let's find which argument we are on | 51 | // If we have a calling expression let's find which argument we are on |
52 | let num_params = call_info.parameters().len(); | 52 | let num_params = call_info.parameters().len(); |
53 | 53 | ||
54 | match num_params.cmp(&1) { | 54 | match num_params { |
55 | Ordering::Less => {} | 55 | 0 => (), |
56 | Ordering::Equal => { | 56 | 1 => { |
57 | if !has_self { | 57 | if !has_self { |
58 | call_info.active_parameter = Some(0); | 58 | call_info.active_parameter = Some(0); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | Ordering::Greater => { | 61 | _ => { |
62 | if let Some(arg_list) = calling_node.arg_list() { | 62 | if let Some(arg_list) = calling_node.arg_list() { |
63 | // Number of arguments specified at the call site | 63 | // Number of arguments specified at the call site |
64 | let num_args_at_callsite = arg_list.args().count(); | 64 | let num_args_at_callsite = arg_list.args().count(); |