Skip to content

Commit 16920fb

Browse files
authored
Merge pull request #1879 from topecongiro/issue-1878
Use correct width for subexpr_list
2 parents 284f3c5 + 10f1257 commit 16920fb

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/chains.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
233233
connector.as_str()
234234
};
235235

236+
let subexpr_num = subexpr_list.len();
236237
let result = if is_small_parent && rewrites.len() > 1 {
237238
let second_connector = choose_first_connector(
238239
context,

tests/source/expr-block.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,7 @@ fn issue_1862() {
282282
/* com */ this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment ,
283283
)
284284
}
285+
286+
fn issue_1878() {
287+
let channel: &str = seq.next_element()?.ok_or_else(|| de::Error::invalid_length(2, &self))?;
288+
}

tests/target/expr-block.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,8 @@ fn issue_1862() {
333333
this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment,
334334
)
335335
}
336+
337+
fn issue_1878() {
338+
let channel: &str = seq.next_element()?
339+
.ok_or_else(|| de::Error::invalid_length(2, &self))?;
340+
}

0 commit comments

Comments
 (0)