diff --git a/src/visitor.rs b/src/visitor.rs index 7b694de4535..ef422ca5924 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -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 {