From 80c241b39a02a949c745676e22b28db95186feda Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 11:44:39 +0200 Subject: Minor --- crates/ra_fmt/src/lib.rs | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'crates/ra_fmt/src') diff --git a/crates/ra_fmt/src/lib.rs b/crates/ra_fmt/src/lib.rs index d0004654b..b92477f9e 100644 --- a/crates/ra_fmt/src/lib.rs +++ b/crates/ra_fmt/src/lib.rs @@ -4,9 +4,7 @@ use std::iter::successors; use syntax::{ ast::{self, AstToken}, - SmolStr, SyntaxKind, - SyntaxKind::*, - SyntaxNode, SyntaxToken, T, + SmolStr, SyntaxNode, SyntaxToken, }; /// If the node is on the beginning of the line, calculate indent. @@ -28,26 +26,3 @@ pub fn leading_indent(node: &SyntaxNode) -> Option { fn prev_tokens(token: SyntaxToken) -> impl Iterator { successors(token.prev_token(), |token| token.prev_token()) } - -pub fn compute_ws(left: SyntaxKind, right: SyntaxKind) -> &'static str { - match left { - T!['('] | T!['['] => return "", - T!['{'] => { - if let USE_TREE = right { - return ""; - } - } - _ => (), - } - match right { - T![')'] | T![']'] => return "", - T!['}'] => { - if let USE_TREE = left { - return ""; - } - } - T![.] => return "", - _ => (), - } - " " -} -- cgit v1.2.3