Skip to content

Commit 8a92910

Browse files
committed
Formatting
1 parent c660a5c commit 8a92910

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

crates/ide-completion/src/completions/env_vars.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ const CARGO_DEFINED_VARS: &[(&str, &str)] = &[
2727
("CARGO_TARGET_TMPDIR","Only set when building integration test or benchmark code. This is a path to a directory inside the target directory where integration tests or benchmarks are free to put any data needed by the tests/benches. Cargo initially creates this directory but doesn't manage its content in any way, this is the responsibility of the test code")
2828
];
2929

30-
pub(crate) fn complete_cargo_env_vars(
31-
acc: &mut Completions,
32-
expanded: &ast::String,
33-
) -> Option<()> {
30+
pub(crate) fn complete_cargo_env_vars(acc: &mut Completions, expanded: &ast::String) -> Option<()> {
3431
guard_env_macro(expanded)?;
3532
let range = expanded.text_range_between_quotes()?;
3633

@@ -57,15 +54,25 @@ mod tests {
5754
use crate::tests::{check_edit, completion_list};
5855

5956
fn check(macro_name: &str) {
60-
check_edit("CARGO_BIN_NAME",&format!(r#"
57+
check_edit(
58+
"CARGO_BIN_NAME",
59+
&format!(
60+
r#"
6161
fn main() {{
6262
let foo = {}!("CAR$0");
6363
}}
64-
"#, macro_name), &format!(r#"
64+
"#,
65+
macro_name
66+
),
67+
&format!(
68+
r#"
6569
fn main() {{
6670
let foo = {}!("CARGO_BIN_NAME");
6771
}}
68-
"#, macro_name));
72+
"#,
73+
macro_name
74+
),
75+
);
6976
}
7077
#[test]
7178
fn completes_env_variable_in_env() {

crates/ide-db/src/syntax_helpers/format_string.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Tools to work with format string literals for the `format_args!` family of macros.
22
use syntax::{
3-
ast::{self, IsString}, TextRange, TextSize,
3+
ast::{self, IsString},
4+
TextRange, TextSize,
45
};
56

67
use super::node_ext::get_outer_macro_name;

crates/ide-db/src/syntax_helpers/node_ext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
use itertools::Itertools;
33
use parser::T;
44
use syntax::{
5-
ast::{self, HasLoopBody, PathSegmentKind, VisibilityKind, NameRef},
6-
AstNode, Preorder, RustLanguage, WalkEvent, AstToken,
5+
ast::{self, HasLoopBody, NameRef, PathSegmentKind, VisibilityKind},
6+
AstNode, AstToken, Preorder, RustLanguage, WalkEvent,
77
};
88

99
pub fn expr_as_name_ref(expr: &ast::Expr) -> Option<ast::NameRef> {
@@ -463,4 +463,4 @@ pub fn get_outer_macro_name(string: &ast::String) -> Option<NameRef> {
463463
let name = macro_call.path()?.segment()?.name_ref()?;
464464

465465
Some(name)
466-
}
466+
}

0 commit comments

Comments
 (0)