Skip to content

Commit 9d29811

Browse files
committed
Fmt corrections
1 parent b70ce55 commit 9d29811

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

crates/ra_ide/src/inlay_hints.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use ra_ide_db::RootDatabase;
55
use ra_prof::profile;
66
use ra_syntax::{
77
ast::{self, ArgListOwner, AstNode, TypeAscriptionOwner},
8-
match_ast, SmolStr, TextRange, NodeOrToken, SyntaxKind, Direction
8+
match_ast, Direction, NodeOrToken, SmolStr, SyntaxKind, TextRange,
99
};
1010

1111
use crate::{FileId, FunctionSignature};
@@ -20,12 +20,7 @@ pub struct InlayHintsOptions {
2020

2121
impl Default for InlayHintsOptions {
2222
fn default() -> Self {
23-
Self {
24-
type_hints: true,
25-
parameter_hints: true,
26-
chaining_hints: true,
27-
max_length: None
28-
}
23+
Self { type_hints: true, parameter_hints: true, chaining_hints: true, max_length: None }
2924
}
3025
}
3126

@@ -86,7 +81,8 @@ fn get_chaining_hints(
8681
return None;
8782
}
8883

89-
let mut tokens = expr.syntax()
84+
let mut tokens = expr
85+
.syntax()
9086
.siblings_with_tokens(Direction::Next)
9187
.filter_map(NodeOrToken::into_token)
9288
.filter(|t| match t.kind() {
@@ -99,7 +95,7 @@ fn get_chaining_hints(
9995
// Ignoring extra whitespace and comments
10096
let next = tokens.next()?.kind();
10197
let next_next = tokens.next()?.kind();
102-
if next == SyntaxKind::WHITESPACE && next_next == SyntaxKind::DOT {
98+
if next == SyntaxKind::WHITESPACE && next_next == SyntaxKind::DOT {
10399
acc.push(InlayHint {
104100
range: expr.syntax().text_range(),
105101
kind: InlayKind::ChainingHint,
@@ -1190,11 +1186,11 @@ fn main() {
11901186
fn generic_chaining_hints() {
11911187
let (analysis, file_id) = single_file(
11921188
r#"
1193-
struct A<T>(T);
1189+
struct A<T>(T);
11941190
struct B<T>(T);
11951191
struct C<T>(T);
11961192
struct X<T,R>(T, R);
1197-
1193+
11981194
impl<T> A<T> {
11991195
fn new(t: T) -> Self { A(t) }
12001196
fn into_b(self) -> B<T> { B(self.0) }
@@ -1211,12 +1207,12 @@ fn main() {
12111207
assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
12121208
[
12131209
InlayHint {
1214-
range: [416; 465),
1210+
range: [403; 452),
12151211
kind: ChainingHint,
12161212
label: "B<X<i32, bool>>",
12171213
},
12181214
InlayHint {
1219-
range: [416; 435),
1215+
range: [403; 422),
12201216
kind: ChainingHint,
12211217
label: "A<X<i32, bool>>",
12221218
},

0 commit comments

Comments
 (0)