Skip to content

Commit 80d7449

Browse files
authored
Merge pull request rust-lang#3069 from topecongiro/issue-3003
Consider a multi-lined array as a block-like expression
2 parents d0c6a6d + 3004822 commit 80d7449

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

src/chains.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ fn is_block_expr(context: &RewriteContext, expr: &ast::Expr, repr: &str) -> bool
844844
ast::ExprKind::Mac(..)
845845
| ast::ExprKind::Call(..)
846846
| ast::ExprKind::MethodCall(..)
847+
| ast::ExprKind::Array(..)
847848
| ast::ExprKind::Struct(..)
848849
| ast::ExprKind::While(..)
849850
| ast::ExprKind::WhileLet(..)

src/config/file_lines.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ mod test {
403403
vec![Range::new(1, 7)],
404404
),
405405
]
406-
.iter()
407-
.cloned()
408-
.collect();
406+
.iter()
407+
.cloned()
408+
.collect();
409409

410410
let file_lines = FileLines::from_ranges(ranges);
411411
let mut spans = file_lines.to_json_spans();

tests/source/expr.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,3 +450,15 @@ fn issue_2802() {
450450
a: some_much_much_longer_value,
451451
}) * some_value
452452
}
453+
454+
fn issue_3003() {
455+
let mut path: PathBuf = [
456+
env!("CARGO_MANIFEST_DIR"),
457+
"tests",
458+
"support",
459+
"dejavu-fonts-ttf-2.37",
460+
"ttf",
461+
]
462+
.iter()
463+
.collect();
464+
}

tests/target/expr.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,3 +529,15 @@ fn issue_2802() {
529529
})
530530
* some_value
531531
}
532+
533+
fn issue_3003() {
534+
let mut path: PathBuf = [
535+
env!("CARGO_MANIFEST_DIR"),
536+
"tests",
537+
"support",
538+
"dejavu-fonts-ttf-2.37",
539+
"ttf",
540+
]
541+
.iter()
542+
.collect();
543+
}

0 commit comments

Comments
 (0)