Skip to content

Commit 3e20502

Browse files
committed
fix logic for the case written several attributes
1 parent 9ea035f commit 3e20502

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

src/imports.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ impl UseTree {
258258
false
259259
};
260260

261+
// FIXME other nice way not to rewrite Rewrite trait
262+
let attr_str = if allow_extend {
263+
attr_str.replace("\n", " ")
264+
} else {
265+
attr_str
266+
};
267+
261268
combine_strs_with_missing_comments(
262269
context,
263270
&attr_str,

tests/source/issue-3343/two.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ use total_len_is::_51___;
1212

1313
/// this is a comment to test is_sugared_doc property
1414
use core::convert;
15+
16+
#[foooooo]
17+
#[barrrrr]
18+
use total_len_is::_50______;

tests/target/issue-3343/one.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ use total_len_is::_51___;
1212

1313
/// this is a comment to test is_sugared_doc property
1414
use core::convert;
15+
16+
#[foooooo]
17+
#[barrrrr]
18+
use total_len_is::_50______;

tests/target/issue-3343/two.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ use total_len_is::_51___;
1010

1111
/// this is a comment to test is_sugared_doc property
1212
use core::convert;
13+
14+
#[foooooo] #[barrrrr] use total_len_is::_50______;

0 commit comments

Comments
 (0)