let prefix = prefix.iter().map(|p| p.rewrite(context, shape));
let slice_pat = slice_pat
.as_ref()
- .map(|p| Some(format!("{}..", p.rewrite(context, shape)?)));
+ .and_then(|p| p.rewrite(context, shape))
+ .map(|rw| Some(format!("{}..", if rw == "_" { "" } else { &rw })));
let suffix = suffix.iter().map(|p| p.rewrite(context, shape));
// Munge them together.
if ellipsis {
if fields_str.contains('\n') || fields_str.len() > one_line_width {
// Add a missing trailing comma.
- if fmt.trailing_separator == SeparatorTactic::Never {
+ if context.config.trailing_comma() == SeparatorTactic::Never {
fields_str.push_str(",");
}
fields_str.push_str("\n");
} else {
if !fields_str.is_empty() {
// there are preceding struct fields being matched on
- if fmt.tactic == DefinitiveListTactic::Vertical {
+ if tactic == DefinitiveListTactic::Vertical {
// if the tactic is Vertical, write_list already added a trailing ,
fields_str.push_str(" ");
} else {