Merge pull request #674 from Ms2ger/start
Use starts_with to avoid panics.
This commit is contained in:
commit
22353ca8c7
@ -69,7 +69,7 @@ pub fn visit_block(&mut self, b: &ast::Block) {
|
||||
|
||||
// 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user