Merge pull request #3069 from topecongiro/issue-3003

Consider a multi-lined array as a block-like expression
This commit is contained in:
Nick Cameron 2018-10-08 13:04:45 +13:00 committed by GitHub
commit 80d744973f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View File

@ -844,6 +844,7 @@ fn is_block_expr(context: &RewriteContext, expr: &ast::Expr, repr: &str) -> bool
ast::ExprKind::Mac(..)
| ast::ExprKind::Call(..)
| ast::ExprKind::MethodCall(..)
| ast::ExprKind::Array(..)
| ast::ExprKind::Struct(..)
| ast::ExprKind::While(..)
| ast::ExprKind::WhileLet(..)

View File

@ -403,9 +403,9 @@ mod test {
vec![Range::new(1, 7)],
),
]
.iter()
.cloned()
.collect();
.iter()
.cloned()
.collect();
let file_lines = FileLines::from_ranges(ranges);
let mut spans = file_lines.to_json_spans();

View File

@ -450,3 +450,15 @@ fn issue_2802() {
a: some_much_much_longer_value,
}) * some_value
}
fn issue_3003() {
let mut path: PathBuf = [
env!("CARGO_MANIFEST_DIR"),
"tests",
"support",
"dejavu-fonts-ttf-2.37",
"ttf",
]
.iter()
.collect();
}

View File

@ -529,3 +529,15 @@ fn issue_2802() {
})
* some_value
}
fn issue_3003() {
let mut path: PathBuf = [
env!("CARGO_MANIFEST_DIR"),
"tests",
"support",
"dejavu-fonts-ttf-2.37",
"ttf",
]
.iter()
.collect();
}