Merge pull request #1734 from topecongiro/raw-string-literal

Allow extending a chain after raw string literal
This commit is contained in:
Nick Cameron 2017-06-20 12:29:25 +12:00 committed by GitHub
commit 1ebbc3cd68
3 changed files with 28 additions and 3 deletions

View file

@ -111,9 +111,10 @@ pub fn trimmed_last_line_width(s: &str) -> usize {
#[inline]
pub fn last_line_extendable(s: &str) -> bool {
s.lines().last().map_or(false, |s| {
s.trim()
.chars()
.all(|c| c == ')' || c == ']' || c == '}' || c == '?')
s.ends_with("\"#") ||
s.trim()
.chars()
.all(|c| c == ')' || c == ']' || c == '}' || c == '?')
})
}

View file

@ -152,3 +152,14 @@ fn issue_1004() {
})
?;
}
fn issue1392() {
test_method(r#"
if foo {
a();
}
else {
b();
}
"#.trim());
}

View file

@ -169,3 +169,16 @@ fn issue_1004() {
in_binder(f, tcx, &ty::Binder(""), Some(tap))
})?;
}
fn issue1392() {
test_method(
r#"
if foo {
a();
}
else {
b();
}
"#.trim(),
);
}