Skip to content

Commit d3b4111

Browse files
committed
fix logic for the case written several attributes
1 parent c1f6ec3 commit d3b4111

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
@@ -268,6 +268,13 @@ impl UseTree {
268268
false
269269
};
270270

271+
// FIXME other nice way not to rewrite Rewrite trait
272+
let attr_str = if allow_extend {
273+
attr_str.replace("\n", " ")
274+
} else {
275+
attr_str
276+
};
277+
271278
combine_strs_with_missing_comments(
272279
context,
273280
&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)