token::SpecialVarNt(var) => format!("${}", var.as_str()),
token::Interpolated(ref nt) => match *nt {
- token::NtExpr(ref e) => expr_to_string(&**e),
- token::NtMeta(ref e) => meta_item_to_string(&**e),
- token::NtTy(ref e) => ty_to_string(&**e),
- token::NtPath(ref e) => path_to_string(&**e),
- token::NtItem(ref e) => item_to_string(&**e),
- token::NtBlock(ref e) => block_to_string(&**e),
- token::NtStmt(ref e) => stmt_to_string(&**e),
- token::NtPat(ref e) => pat_to_string(&**e),
+ token::NtExpr(ref e) => expr_to_string(&e),
+ token::NtMeta(ref e) => meta_item_to_string(&e),
+ token::NtTy(ref e) => ty_to_string(&e),
+ token::NtPath(ref e) => path_to_string(&e),
+ token::NtItem(ref e) => item_to_string(&e),
+ token::NtBlock(ref e) => block_to_string(&e),
+ token::NtStmt(ref e) => stmt_to_string(&e),
+ token::NtPat(ref e) => pat_to_string(&e),
token::NtIdent(ref e, _) => ident_to_string(e.node),
- token::NtTT(ref e) => tt_to_string(&**e),
- token::NtArm(ref e) => arm_to_string(&*e),
- token::NtImplItem(ref e) => impl_item_to_string(&**e),
- token::NtTraitItem(ref e) => trait_item_to_string(&**e),
- token::NtGenerics(ref e) => generics_to_string(&*e),
- token::NtWhereClause(ref e) => where_clause_to_string(&*e),
- token::NtArg(ref e) => arg_to_string(&*e),
+ token::NtTT(ref e) => tt_to_string(&e),
+ token::NtArm(ref e) => arm_to_string(&e),
+ token::NtImplItem(ref e) => impl_item_to_string(&e),
+ token::NtTraitItem(ref e) => trait_item_to_string(&e),
+ token::NtGenerics(ref e) => generics_to_string(&e),
+ token::NtWhereClause(ref e) => where_clause_to_string(&e),
+ token::NtArg(ref e) => arg_to_string(&e),
}
}
}
ast::AttrStyle::Inner => try!(word(self.writer(), "#![")),
ast::AttrStyle::Outer => try!(word(self.writer(), "#[")),
}
- try!(self.print_meta_item(&*attr.meta()));
+ try!(self.print_meta_item(&attr.meta()));
word(self.writer(), "]")
}
}
try!(self.popen());
try!(self.commasep(Consistent,
&items[..],
- |s, i| s.print_meta_item(&**i)));
+ |s, i| s.print_meta_item(&i)));
try!(self.pclose());
}
}
pub fn commasep_exprs(&mut self, b: Breaks,
exprs: &[P<ast::Expr>]) -> io::Result<()> {
- self.commasep_cmnt(b, exprs, |s, e| s.print_expr(&**e), |e| e.span)
+ self.commasep_cmnt(b, exprs, |s, e| s.print_expr(&e), |e| e.span)
}
pub fn print_mod(&mut self, _mod: &ast::Mod,
attrs: &[ast::Attribute]) -> io::Result<()> {
try!(self.print_inner_attributes(attrs));
for item in &_mod.items {
- try!(self.print_item(&**item));
+ try!(self.print_item(&item));
}
Ok(())
}
match ty.node {
ast::TyKind::Vec(ref ty) => {
try!(word(&mut self.s, "["));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
try!(word(&mut self.s, "]"));
}
ast::TyKind::Ptr(ref mt) => {
ast::Mutability::Mutable => try!(self.word_nbsp("mut")),
ast::Mutability::Immutable => try!(self.word_nbsp("const")),
}
- try!(self.print_type(&*mt.ty));
+ try!(self.print_type(&mt.ty));
}
ast::TyKind::Rptr(ref lifetime, ref mt) => {
try!(word(&mut self.s, "&"));
ast::TyKind::Tup(ref elts) => {
try!(self.popen());
try!(self.commasep(Inconsistent, &elts[..],
- |s, ty| s.print_type(&**ty)));
+ |s, ty| s.print_type(&ty)));
if elts.len() == 1 {
try!(word(&mut self.s, ","));
}
}
ast::TyKind::Paren(ref typ) => {
try!(self.popen());
- try!(self.print_type(&**typ));
+ try!(self.print_type(&typ));
try!(self.pclose());
}
ast::TyKind::BareFn(ref f) => {
};
try!(self.print_ty_fn(f.abi,
f.unsafety,
- &*f.decl,
+ &f.decl,
None,
&generics,
None));
try!(self.print_qpath(path, qself, false))
}
ast::TyKind::ObjectSum(ref ty, ref bounds) => {
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
try!(self.print_bounds("+", &bounds[..]));
}
ast::TyKind::PolyTraitRef(ref bounds) => {
}
ast::TyKind::FixedLengthVec(ref ty, ref v) => {
try!(word(&mut self.s, "["));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
try!(word(&mut self.s, "; "));
- try!(self.print_expr(&**v));
+ try!(self.print_expr(&v));
try!(word(&mut self.s, "]"));
}
ast::TyKind::Typeof(ref e) => {
try!(word(&mut self.s, "typeof("));
- try!(self.print_expr(&**e));
+ try!(self.print_expr(&e));
try!(word(&mut self.s, ")"));
}
ast::TyKind::Infer => {
}
try!(self.print_ident(item.ident));
try!(self.word_space(":"));
- try!(self.print_type(&**t));
+ try!(self.print_type(&t));
try!(word(&mut self.s, ";"));
try!(self.end()); // end the head-ibox
self.end() // end the outer cbox
ast::ItemKind::Use(ref vp) => {
try!(self.head(&visibility_qualified(item.vis,
"use")));
- try!(self.print_view_path(&**vp));
+ try!(self.print_view_path(&vp));
try!(word(&mut self.s, ";"));
try!(self.end()); // end inner head-block
try!(self.end()); // end outer head-block
}
try!(self.print_ident(item.ident));
try!(self.word_space(":"));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
try!(space(&mut self.s));
try!(self.end()); // end the head-ibox
try!(self.word_space("="));
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(word(&mut self.s, ";"));
try!(self.end()); // end the outer cbox
}
"const")));
try!(self.print_ident(item.ident));
try!(self.word_space(":"));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
try!(space(&mut self.s));
try!(self.end()); // end the head-ibox
try!(self.word_space("="));
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(word(&mut self.s, ";"));
try!(self.end()); // end the outer cbox
}
item.vis
));
try!(word(&mut self.s, " "));
- try!(self.print_block_with_attrs(&**body, &item.attrs));
+ try!(self.print_block_with_attrs(&body, &item.attrs));
}
ast::ItemKind::Mod(ref _mod) => {
try!(self.head(&visibility_qualified(item.vis,
try!(self.print_where_clause(¶ms.where_clause));
try!(space(&mut self.s));
try!(self.word_space("="));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
try!(word(&mut self.s, ";"));
try!(self.end()); // end the outer ibox
}
None => {}
}
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
try!(self.print_where_clause(&generics.where_clause));
try!(space(&mut self.s));
ast::UnnamedField(vis) => {
try!(s.print_visibility(vis));
try!(s.maybe_print_comment(field.span.lo));
- s.print_type(&*field.node.ty)
+ s.print_type(&field.node.ty)
}
}
}
try!(self.print_visibility(visibility));
try!(self.print_ident(ident));
try!(self.word_nbsp(":"));
- try!(self.print_type(&*field.node.ty));
+ try!(self.print_type(&field.node.ty));
try!(word(&mut self.s, ","));
}
}
Some(ref d) => {
try!(space(&mut self.s));
try!(self.word_space("="));
- self.print_expr(&**d)
+ self.print_expr(&d)
}
_ => Ok(())
}
try!(self.maybe_print_comment(st.span.lo));
match st.node {
ast::StmtKind::Decl(ref decl, _) => {
- try!(self.print_decl(&**decl));
+ try!(self.print_decl(&decl));
}
ast::StmtKind::Expr(ref expr, _) => {
try!(self.space_if_not_bol());
- try!(self.print_expr_outer_attr_style(&**expr, false));
+ try!(self.print_expr_outer_attr_style(&expr, false));
}
ast::StmtKind::Semi(ref expr, _) => {
try!(self.space_if_not_bol());
- try!(self.print_expr_outer_attr_style(&**expr, false));
+ try!(self.print_expr_outer_attr_style(&expr, false));
try!(word(&mut self.s, ";"));
}
ast::StmtKind::Mac(ref mac, style, ref attrs) => {
ast::MacStmtStyle::Braces => token::Brace,
_ => token::Paren
};
- try!(self.print_mac(&**mac, delim));
+ try!(self.print_mac(&mac, delim));
match style {
ast::MacStmtStyle::Braces => {}
_ => try!(word(&mut self.s, ";")),
match blk.expr {
Some(ref expr) => {
try!(self.space_if_not_bol());
- try!(self.print_expr_outer_attr_style(&**expr, false));
+ try!(self.print_expr_outer_attr_style(&expr, false));
try!(self.maybe_print_trailing_comment(expr.span, Some(blk.span.hi)));
}
_ => ()
try!(self.cbox(INDENT_UNIT - 1));
try!(self.ibox(0));
try!(word(&mut self.s, " else if "));
- try!(self.print_expr(&**i));
+ try!(self.print_expr(&i));
try!(space(&mut self.s));
- try!(self.print_block(&**then));
+ try!(self.print_block(&then));
self.print_else(e.as_ref().map(|e| &**e))
}
// "another else-if-let"
try!(self.cbox(INDENT_UNIT - 1));
try!(self.ibox(0));
try!(word(&mut self.s, " else if let "));
- try!(self.print_pat(&**pat));
+ try!(self.print_pat(&pat));
try!(space(&mut self.s));
try!(self.word_space("="));
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(space(&mut self.s));
- try!(self.print_block(&**then));
+ try!(self.print_block(&then));
self.print_else(e.as_ref().map(|e| &**e))
}
// "final else"
try!(self.cbox(INDENT_UNIT - 1));
try!(self.ibox(0));
try!(word(&mut self.s, " else "));
- self.print_block(&**b)
+ self.print_block(&b)
}
// BLEAH, constraints would be great here
_ => {
try!(s.ibox(INDENT_UNIT));
try!(s.print_ident(field.ident.node));
try!(s.word_space(":"));
- try!(s.print_expr(&*field.expr));
+ try!(s.print_expr(&field.expr));
s.end()
},
|f| f.span));
try!(space(&mut self.s));
}
try!(word(&mut self.s, ".."));
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(self.end());
}
_ => if !fields.is_empty() {
tys: &[P<ast::Ty>],
args: &[P<ast::Expr>]) -> io::Result<()> {
let base_args = &args[1..];
- try!(self.print_expr(&*args[0]));
+ try!(self.print_expr(&args[0]));
try!(word(&mut self.s, "."));
try!(self.print_ident(ident.node));
if !tys.is_empty() {
try!(word(&mut self.s, "::<"));
try!(self.commasep(Inconsistent, tys,
- |s, ty| s.print_type(&**ty)));
+ |s, ty| s.print_type(&ty)));
try!(word(&mut self.s, ">"));
}
self.print_call_post(base_args)
try!(self.print_expr_vec(&exprs[..], attrs));
}
ast::ExprKind::Repeat(ref element, ref count) => {
- try!(self.print_expr_repeat(&**element, &**count, attrs));
+ try!(self.print_expr_repeat(&element, &count, attrs));
}
ast::ExprKind::Struct(ref path, ref fields, ref wth) => {
try!(self.print_expr_struct(path, &fields[..], wth, attrs));
try!(self.print_expr_tup(&exprs[..], attrs));
}
ast::ExprKind::Call(ref func, ref args) => {
- try!(self.print_expr_call(&**func, &args[..]));
+ try!(self.print_expr_call(&func, &args[..]));
}
ast::ExprKind::MethodCall(ident, ref tys, ref args) => {
try!(self.print_expr_method_call(ident, &tys[..], &args[..]));
}
ast::ExprKind::Binary(op, ref lhs, ref rhs) => {
- try!(self.print_expr_binary(op, &**lhs, &**rhs));
+ try!(self.print_expr_binary(op, &lhs, &rhs));
}
ast::ExprKind::Unary(op, ref expr) => {
- try!(self.print_expr_unary(op, &**expr));
+ try!(self.print_expr_unary(op, &expr));
}
ast::ExprKind::AddrOf(m, ref expr) => {
- try!(self.print_expr_addr_of(m, &**expr));
+ try!(self.print_expr_addr_of(m, &expr));
}
ast::ExprKind::Lit(ref lit) => {
- try!(self.print_literal(&**lit));
+ try!(self.print_literal(&lit));
}
ast::ExprKind::Cast(ref expr, ref ty) => {
if let ast::ExprKind::Cast(..) = expr.node {
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
} else {
- try!(self.print_expr_maybe_paren(&**expr));
+ try!(self.print_expr_maybe_paren(&expr));
}
try!(space(&mut self.s));
try!(self.word_space("as"));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
}
ast::ExprKind::Type(ref expr, ref ty) => {
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(self.word_space(":"));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
}
ast::ExprKind::If(ref test, ref blk, ref elseopt) => {
- try!(self.print_if(&**test, &**blk, elseopt.as_ref().map(|e| &**e)));
+ try!(self.print_if(&test, &blk, elseopt.as_ref().map(|e| &**e)));
}
ast::ExprKind::IfLet(ref pat, ref expr, ref blk, ref elseopt) => {
- try!(self.print_if_let(&**pat, &**expr, &** blk, elseopt.as_ref().map(|e| &**e)));
+ try!(self.print_if_let(&pat, &expr, &blk, elseopt.as_ref().map(|e| &**e)));
}
ast::ExprKind::While(ref test, ref blk, opt_ident) => {
if let Some(ident) = opt_ident {
try!(self.word_space(":"));
}
try!(self.head("while"));
- try!(self.print_expr(&**test));
+ try!(self.print_expr(&test));
try!(space(&mut self.s));
- try!(self.print_block_with_attrs(&**blk, attrs));
+ try!(self.print_block_with_attrs(&blk, attrs));
}
ast::ExprKind::WhileLet(ref pat, ref expr, ref blk, opt_ident) => {
if let Some(ident) = opt_ident {
try!(self.word_space(":"));
}
try!(self.head("while let"));
- try!(self.print_pat(&**pat));
+ try!(self.print_pat(&pat));
try!(space(&mut self.s));
try!(self.word_space("="));
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(space(&mut self.s));
- try!(self.print_block_with_attrs(&**blk, attrs));
+ try!(self.print_block_with_attrs(&blk, attrs));
}
ast::ExprKind::ForLoop(ref pat, ref iter, ref blk, opt_ident) => {
if let Some(ident) = opt_ident {
try!(self.word_space(":"));
}
try!(self.head("for"));
- try!(self.print_pat(&**pat));
+ try!(self.print_pat(&pat));
try!(space(&mut self.s));
try!(self.word_space("in"));
- try!(self.print_expr(&**iter));
+ try!(self.print_expr(&iter));
try!(space(&mut self.s));
- try!(self.print_block_with_attrs(&**blk, attrs));
+ try!(self.print_block_with_attrs(&blk, attrs));
}
ast::ExprKind::Loop(ref blk, opt_ident) => {
if let Some(ident) = opt_ident {
}
try!(self.head("loop"));
try!(space(&mut self.s));
- try!(self.print_block_with_attrs(&**blk, attrs));
+ try!(self.print_block_with_attrs(&blk, attrs));
}
ast::ExprKind::Match(ref expr, ref arms) => {
try!(self.cbox(INDENT_UNIT));
try!(self.ibox(4));
try!(self.word_nbsp("match"));
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(space(&mut self.s));
try!(self.bopen());
try!(self.print_inner_attributes_no_trailing_hardbreak(attrs));
ast::ExprKind::Closure(capture_clause, ref decl, ref body) => {
try!(self.print_capture_clause(capture_clause));
- try!(self.print_fn_block_args(&**decl));
+ try!(self.print_fn_block_args(&decl));
try!(space(&mut self.s));
let default_return = match decl.output {
};
if !default_return || !body.stmts.is_empty() || body.expr.is_none() {
- try!(self.print_block_unclosed(&**body));
+ try!(self.print_block_unclosed(&body));
} else {
// we extract the block, so as not to create another set of boxes
let i_expr = body.expr.as_ref().unwrap();
match i_expr.node {
ast::ExprKind::Block(ref blk) => {
try!(self.print_block_unclosed_with_attrs(
- &**blk,
+ &blk,
i_expr.attrs.as_attr_slice()));
}
_ => {
// this is a bare expression
- try!(self.print_expr(&**i_expr));
+ try!(self.print_expr(&i_expr));
try!(self.end()); // need to close a box
}
}
try!(self.cbox(INDENT_UNIT));
// head-box, will be closed by print-block after {
try!(self.ibox(0));
- try!(self.print_block_with_attrs(&**blk, attrs));
+ try!(self.print_block_with_attrs(&blk, attrs));
}
ast::ExprKind::Assign(ref lhs, ref rhs) => {
- try!(self.print_expr(&**lhs));
+ try!(self.print_expr(&lhs));
try!(space(&mut self.s));
try!(self.word_space("="));
- try!(self.print_expr(&**rhs));
+ try!(self.print_expr(&rhs));
}
ast::ExprKind::AssignOp(op, ref lhs, ref rhs) => {
- try!(self.print_expr(&**lhs));
+ try!(self.print_expr(&lhs));
try!(space(&mut self.s));
try!(word(&mut self.s, op.node.to_string()));
try!(self.word_space("="));
- try!(self.print_expr(&**rhs));
+ try!(self.print_expr(&rhs));
}
ast::ExprKind::Field(ref expr, id) => {
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(word(&mut self.s, "."));
try!(self.print_ident(id.node));
}
ast::ExprKind::TupField(ref expr, id) => {
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(word(&mut self.s, "."));
try!(self.print_usize(id.node));
}
ast::ExprKind::Index(ref expr, ref index) => {
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
try!(word(&mut self.s, "["));
- try!(self.print_expr(&**index));
+ try!(self.print_expr(&index));
try!(word(&mut self.s, "]"));
}
ast::ExprKind::Range(ref start, ref end) => {
if let &Some(ref e) = start {
- try!(self.print_expr(&**e));
+ try!(self.print_expr(&e));
}
try!(word(&mut self.s, ".."));
if let &Some(ref e) = end {
- try!(self.print_expr(&**e));
+ try!(self.print_expr(&e));
}
}
ast::ExprKind::Path(None, ref path) => {
match *result {
Some(ref expr) => {
try!(word(&mut self.s, " "));
- try!(self.print_expr(&**expr));
+ try!(self.print_expr(&expr));
}
_ => ()
}
_ => try!(s.print_string(&out.constraint, ast::StrStyle::Cooked))
}
try!(s.popen());
- try!(s.print_expr(&*out.expr));
+ try!(s.print_expr(&out.expr));
try!(s.pclose());
Ok(())
}));
|s, &(ref co, ref o)| {
try!(s.print_string(&co, ast::StrStyle::Cooked));
try!(s.popen());
- try!(s.print_expr(&**o));
+ try!(s.print_expr(&o));
try!(s.pclose());
Ok(())
}));
if !options.is_empty() {
try!(space(&mut self.s));
try!(self.word_space(":"));
- try!(self.commasep(Inconsistent, &*options,
+ try!(self.commasep(Inconsistent, &options,
|s, &co| {
try!(s.print_string(co, ast::StrStyle::Cooked));
Ok(())
ast::ExprKind::Paren(ref e) => {
try!(self.popen());
try!(self.print_inner_attributes_inline(attrs));
- try!(self.print_expr(&**e));
+ try!(self.print_expr(&e));
try!(self.pclose());
}
}
}
pub fn print_local_decl(&mut self, loc: &ast::Local) -> io::Result<()> {
- try!(self.print_pat(&*loc.pat));
+ try!(self.print_pat(&loc.pat));
if let Some(ref ty) = loc.ty {
try!(self.word_space(":"));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
}
Ok(())
}
try!(self.word_nbsp("let"));
try!(self.ibox(INDENT_UNIT));
- try!(self.print_local_decl(&**loc));
+ try!(self.print_local_decl(&loc));
try!(self.end());
if let Some(ref init) = loc.init {
try!(self.nbsp());
try!(self.word_space("="));
- try!(self.print_expr(&**init));
+ try!(self.print_expr(&init));
}
self.end()
}
- ast::DeclKind::Item(ref item) => self.print_item(&**item)
+ ast::DeclKind::Item(ref item) => self.print_item(&item)
}
}
try!(self.commasep(
Inconsistent,
&data.types,
- |s, ty| s.print_type(&**ty)));
+ |s, ty| s.print_type(&ty)));
comma = true;
}
try!(self.print_ident(binding.ident));
try!(space(&mut self.s));
try!(self.word_space("="));
- try!(self.print_type(&*binding.ty));
+ try!(self.print_type(&binding.ty));
comma = true;
}
try!(self.commasep(
Inconsistent,
&data.inputs,
- |s, ty| s.print_type(&**ty)));
+ |s, ty| s.print_type(&ty)));
try!(word(&mut self.s, ")"));
match data.output {
Some(ref ty) => {
try!(self.space_if_not_bol());
try!(self.word_space("->"));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
}
}
}
match *sub {
Some(ref p) => {
try!(word(&mut self.s, "@"));
- try!(self.print_pat(&**p));
+ try!(self.print_pat(&p));
}
None => ()
}
if !args.is_empty() {
try!(self.popen());
try!(self.commasep(Inconsistent, &args[..],
- |s, p| s.print_pat(&**p)));
+ |s, p| s.print_pat(&p)));
try!(self.pclose());
}
}
try!(s.print_ident(f.node.ident));
try!(s.word_nbsp(":"));
}
- try!(s.print_pat(&*f.node.pat));
+ try!(s.print_pat(&f.node.pat));
s.end()
},
|f| f.node.pat.span));
try!(self.popen());
try!(self.commasep(Inconsistent,
&elts[..],
- |s, p| s.print_pat(&**p)));
+ |s, p| s.print_pat(&p)));
if elts.len() == 1 {
try!(word(&mut self.s, ","));
}
}
ast::PatBox(ref inner) => {
try!(word(&mut self.s, "box "));
- try!(self.print_pat(&**inner));
+ try!(self.print_pat(&inner));
}
ast::PatRegion(ref inner, mutbl) => {
try!(word(&mut self.s, "&"));
if mutbl == ast::Mutability::Mutable {
try!(word(&mut self.s, "mut "));
}
- try!(self.print_pat(&**inner));
+ try!(self.print_pat(&inner));
}
- ast::PatLit(ref e) => try!(self.print_expr(&**e)),
+ ast::PatLit(ref e) => try!(self.print_expr(&e)),
ast::PatRange(ref begin, ref end) => {
- try!(self.print_expr(&**begin));
+ try!(self.print_expr(&begin));
try!(space(&mut self.s));
try!(word(&mut self.s, "..."));
- try!(self.print_expr(&**end));
+ try!(self.print_expr(&end));
}
ast::PatVec(ref before, ref slice, ref after) => {
try!(word(&mut self.s, "["));
try!(self.commasep(Inconsistent,
&before[..],
- |s, p| s.print_pat(&**p)));
+ |s, p| s.print_pat(&p)));
if let Some(ref p) = *slice {
if !before.is_empty() { try!(self.word_space(",")); }
if p.node != ast::PatWild {
- try!(self.print_pat(&**p));
+ try!(self.print_pat(&p));
}
try!(word(&mut self.s, ".."));
if !after.is_empty() { try!(self.word_space(",")); }
}
try!(self.commasep(Inconsistent,
&after[..],
- |s, p| s.print_pat(&**p)));
+ |s, p| s.print_pat(&p)));
try!(word(&mut self.s, "]"));
}
ast::PatMac(ref m) => try!(self.print_mac(m, token::Paren)),
try!(space(&mut self.s));
try!(self.word_space("|"));
}
- try!(self.print_pat(&**p));
+ try!(self.print_pat(&p));
}
try!(space(&mut self.s));
if let Some(ref e) = arm.guard {
try!(self.word_space("if"));
- try!(self.print_expr(&**e));
+ try!(self.print_expr(&e));
try!(space(&mut self.s));
}
try!(self.word_space("=>"));
match arm.body.node {
ast::ExprKind::Block(ref blk) => {
// the block will close the pattern's ibox
- try!(self.print_block_unclosed_indent(&**blk, INDENT_UNIT));
+ try!(self.print_block_unclosed_indent(&blk, INDENT_UNIT));
// If it is a user-provided unsafe block, print a comma after it
if let BlockCheckMode::Unsafe(ast::UserProvided) = blk.rules {
}
_ => {
try!(self.end()); // close the ibox for the pattern
- try!(self.print_expr(&*arm.body));
+ try!(self.print_expr(&arm.body));
try!(word(&mut self.s, ","));
}
}
ast::SelfKind::Explicit(ref typ, _) => {
try!(word(&mut self.s, "self"));
try!(self.word_space(":"));
- try!(self.print_type(&**typ));
+ try!(self.print_type(&typ));
}
}
return Ok(true);
try!(self.word_space("->"));
match decl.output {
ast::FunctionRetTy::Ty(ref ty) => {
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
self.maybe_print_comment(ty.span.lo)
}
ast::FunctionRetTy::Default(..) => unreachable!(),
Some(ref default) => {
try!(space(&mut self.s));
try!(self.word_space("="));
- self.print_type(&**default)
+ self.print_type(&default)
}
_ => Ok(())
}
ref bounds,
..}) => {
try!(self.print_formal_lifetime_list(bound_lifetimes));
- try!(self.print_type(&**bounded_ty));
+ try!(self.print_type(&bounded_ty));
try!(self.print_bounds(":", bounds));
}
ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{ref lifetime,
try!(self.print_path(path, false, 0));
try!(space(&mut self.s));
try!(self.word_space("="));
- try!(self.print_type(&**ty));
+ try!(self.print_type(&ty));
}
}
}
pub fn print_mt(&mut self, mt: &ast::MutTy) -> io::Result<()> {
try!(self.print_mutability(mt.mutbl));
- self.print_type(&*mt.ty)
+ self.print_type(&mt.ty)
}
pub fn print_arg(&mut self, input: &ast::Arg, is_closure: bool) -> io::Result<()> {
try!(self.ibox(INDENT_UNIT));
match input.ty.node {
- ast::TyKind::Infer if is_closure => try!(self.print_pat(&*input.pat)),
+ ast::TyKind::Infer if is_closure => try!(self.print_pat(&input.pat)),
_ => {
match input.pat.node {
ast::PatIdent(_, ref path1, _) if
// Do nothing.
}
_ => {
- try!(self.print_pat(&*input.pat));
+ try!(self.print_pat(&input.pat));
try!(word(&mut self.s, ":"));
try!(space(&mut self.s));
}
}
- try!(self.print_type(&*input.ty));
+ try!(self.print_type(&input.ty));
}
}
self.end()
try!(self.word_nbsp("!")),
ast::FunctionRetTy::Default(..) => unreachable!(),
ast::FunctionRetTy::Ty(ref ty) =>
- try!(self.print_type(&**ty))
+ try!(self.print_type(&ty))
}
try!(self.end());