Merge pull request #674 from Ms2ger/start

Use starts_with to avoid panics.
This commit is contained in:
Marcus Klaas de Vries 2015-12-04 16:37:59 +01:00
commit 22353ca8c7

View file

@ -69,7 +69,7 @@ impl<'a> FmtVisitor<'a> {
// Check if this block has braces.
let snippet = self.snippet(b.span);
let has_braces = &snippet[..1] == "{" || &snippet[..6] == "unsafe";
let has_braces = snippet.starts_with("{") || snippet.starts_with("unsafe");
let brace_compensation = if has_braces {
BytePos(1)
} else {