Format source codes
This commit is contained in:
parent
a91fd699a0
commit
0614e94d0d
18
src/expr.rs
18
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<String> {
|
||||
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.
|
||||
|
@ -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))
|
||||
|
@ -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> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user