//! ```
use codemap::SpanUtils;
+use comment::rewrite_comment;
use config::IndentStyle;
use expr::rewrite_call;
use macros::convert_try_mac;
),
StructField(ast::Ident),
TupleField(ast::Ident, bool),
+ Comment,
}
impl ChainItemKind {
match self {
ChainItemKind::Parent(ref expr) => is_block_expr(context, expr, reps),
ChainItemKind::MethodCall(..) => reps.contains('\n'),
- ChainItemKind::StructField(..) | ChainItemKind::TupleField(..) => false,
+ ChainItemKind::StructField(..)
+ | ChainItemKind::TupleField(..)
+ | ChainItemKind::Comment => false,
}
}
ChainItemKind::TupleField(ident, nested) => {
format!("{}.{}", if nested { " " } else { "" }, ident.name)
}
+ ChainItemKind::Comment => {
+ rewrite_comment(context.snippet(self.span).trim(), false, shape, context.config)?
+ }
};
Some(format!("{}{}", rewrite, "?".repeat(self.tries)))
}