diff options
author | Domantas Jadenkus <[email protected]> | 2021-02-13 20:51:48 +0000 |
---|---|---|
committer | Domantas Jadenkus <[email protected]> | 2021-02-13 20:51:48 +0000 |
commit | 7f100fff92ab4944f3d49cf7ffdcd91fc3578936 (patch) | |
tree | 5c3de8598d60c9ec74be9f00a3affefa68ab9c04 /crates/assists/src/utils.rs | |
parent | 36e8a55bee478d296f3903eb4b14914914801b38 (diff) |
cargo fmt
Diffstat (limited to 'crates/assists/src/utils.rs')
-rw-r--r-- | crates/assists/src/utils.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/assists/src/utils.rs b/crates/assists/src/utils.rs index b51d703db..98c4462bb 100644 --- a/crates/assists/src/utils.rs +++ b/crates/assists/src/utils.rs | |||
@@ -380,11 +380,8 @@ fn generate_impl_text_inner(adt: &ast::Adt, trait_text: Option<&str>, code: &str | |||
380 | let type_params = adt.generic_param_list(); | 380 | let type_params = adt.generic_param_list(); |
381 | let mut buf = String::with_capacity(code.len()); | 381 | let mut buf = String::with_capacity(code.len()); |
382 | buf.push_str("\n\n"); | 382 | buf.push_str("\n\n"); |
383 | adt | 383 | adt.attrs() |
384 | .attrs() | 384 | .filter(|attr| attr.as_simple_call().map(|(name, _arg)| name == "cfg").unwrap_or(false)) |
385 | .filter(|attr| { | ||
386 | attr.as_simple_call().map(|(name, _arg)| name == "cfg").unwrap_or(false) | ||
387 | }) | ||
388 | .for_each(|attr| buf.push_str(format!("{}\n", attr.to_string()).as_str())); | 385 | .for_each(|attr| buf.push_str(format!("{}\n", attr.to_string()).as_str())); |
389 | buf.push_str("impl"); | 386 | buf.push_str("impl"); |
390 | if let Some(type_params) = &type_params { | 387 | if let Some(type_params) = &type_params { |