1
Fork 0

Allow {} to remain.

This commit is contained in:
Nick Cameron 2015-08-16 16:13:55 +12:00
parent dc2544712c
commit d10629d8a5
4 changed files with 37 additions and 10 deletions

View file

@ -112,6 +112,11 @@ impl Rewrite for ast::Expr {
impl Rewrite for ast::Block {
fn rewrite(&self, context: &RewriteContext, width: usize, offset: usize) -> Option<String> {
let user_str = context.codemap.span_to_snippet(self.span).unwrap();
if user_str == "{}" && width > 1 {
return Some(user_str);
}
let mut visitor = FmtVisitor::from_codemap(context.codemap, context.config);
visitor.block_indent = context.block_indent;