From 4fcba8b1bf1b94839902c0803501163b7628b33d Mon Sep 17 00:00:00 2001 From: ivan770 Date: Tue, 30 Mar 2021 12:58:41 +0200 Subject: Fix code style --- crates/ide/src/hover.rs | 1 + crates/ide/src/move_item.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 3c951c507..02a1a5b37 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -470,6 +470,7 @@ fn find_std_module(famous_defs: &FamousDefs, name: &str) -> Option fn pick_best(tokens: TokenAtOffset) -> Option { return tokens.max_by_key(priority); + fn priority(n: &SyntaxToken) -> usize { match n.kind() { IDENT | INT_NUMBER | LIFETIME_IDENT | T![self] | T![super] | T![crate] => 3, diff --git a/crates/ide/src/move_item.rs b/crates/ide/src/move_item.rs index 089383aa6..d36dcd4e4 100644 --- a/crates/ide/src/move_item.rs +++ b/crates/ide/src/move_item.rs @@ -143,6 +143,7 @@ fn replace_nodes(first: &SyntaxNode, second: &SyntaxNode) -> TextEdit { fn pick_best(tokens: TokenAtOffset) -> Option { return tokens.max_by_key(priority); + fn priority(n: &SyntaxToken) -> usize { match n.kind() { SyntaxKind::IDENT | SyntaxKind::LIFETIME_IDENT => 2, -- cgit v1.2.3