Skip to content

Commit c5c5f42

Browse files
committed
Readability
1 parent a82c679 commit c5c5f42

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/ra_ide/src/call_info.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use ra_syntax::{
44
ast::{self, ArgListOwner},
55
match_ast, AstNode, SyntaxNode,
66
};
7-
use std::cmp::Ordering;
7+
88
use test_utils::tested_by;
99

1010
use crate::{
@@ -51,14 +51,14 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option<Cal
5151
// If we have a calling expression let's find which argument we are on
5252
let num_params = call_info.parameters().len();
5353

54-
match num_params.cmp(&1) {
55-
Ordering::Less => {}
56-
Ordering::Equal => {
54+
match num_params {
55+
0 => (),
56+
1 => {
5757
if !has_self {
5858
call_info.active_parameter = Some(0);
5959
}
6060
}
61-
Ordering::Greater => {
61+
_ => {
6262
if let Some(arg_list) = calling_node.arg_list() {
6363
// Number of arguments specified at the call site
6464
let num_args_at_callsite = arg_list.args().count();

crates/ra_parser/src/grammar/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) {
9494

9595
fn opt_path_type_args(p: &mut Parser, mode: Mode) {
9696
match mode {
97-
Mode::Use => {}
97+
Mode::Use => return,
9898
Mode::Type => {
9999
// test path_fn_trait_args
100100
// type F = Box<Fn(x: i32) -> ()>;

0 commit comments

Comments
 (0)