From 0614e94d0df2d50f7f16e93c469006a31294ec6d Mon Sep 17 00:00:00 2001 From: topecongiro Date: Sat, 15 Apr 2017 18:42:45 +0900 Subject: [PATCH] Format source codes --- src/expr.rs | 18 +++++++++--------- src/imports.rs | 6 +++--- tests/target/closure.rs | 16 ++++++++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index 0a17bff9d01..7b4153083cb 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1230,10 +1230,10 @@ fn rewrite_match(context: &RewriteContext, fn arm_start_pos(arm: &ast::Arm) -> BytePos { let &ast::Arm { - ref attrs, - ref pats, - .. - } = arm; + ref attrs, + ref pats, + .. + } = arm; if !attrs.is_empty() { return attrs[0].span.lo; } @@ -1264,11 +1264,11 @@ impl Rewrite for ast::Arm { fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option { debug!("Arm::rewrite {:?} {:?}", self, shape); let &ast::Arm { - ref attrs, - ref pats, - ref guard, - ref body, - } = self; + ref attrs, + ref pats, + ref guard, + ref body, + } = self; // FIXME this is all a bit grotty, would be nice to abstract out the // treatment of attributes. diff --git a/src/imports.rs b/src/imports.rs index 791ff0ee387..99651159b2a 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -133,9 +133,9 @@ fn rewrite_view_path_prefix(path: &ast::Path, let path_str = if path.segments.last().unwrap().identifier.to_string() == "self" && path.segments.len() > 1 { let path = &ast::Path { - span: path.span.clone(), - segments: path.segments[..path.segments.len() - 1].to_owned(), - }; + span: path.span.clone(), + segments: path.segments[..path.segments.len() - 1].to_owned(), + }; try_opt!(rewrite_path(context, PathContext::Import, None, path, shape)) } else { try_opt!(rewrite_path(context, PathContext::Import, None, path, shape)) diff --git a/tests/target/closure.rs b/tests/target/closure.rs index ad6b48aeac9..c9edec799e2 100644 --- a/tests/target/closure.rs +++ b/tests/target/closure.rs @@ -74,16 +74,16 @@ fn issue863() { fn issue934() { let hash: &Fn(&&Block) -> u64 = &|block| -> u64 { - let mut h = SpanlessHash::new(cx); - h.hash_block(block); - h.finish() - }; + let mut h = SpanlessHash::new(cx); + h.hash_block(block); + h.finish() + }; let hash: &Fn(&&Block) -> u64 = &|block| -> u64 { - let mut h = SpanlessHash::new(cx); - h.hash_block(block); - h.finish(); - }; + let mut h = SpanlessHash::new(cx); + h.hash_block(block); + h.finish(); + }; } impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {