Skip to content

Commit ad903e0

Browse files
committed
Keep formatting fn even if there is an unformattable argument
1 parent d830105 commit ad903e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/items.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,8 +2232,10 @@ fn rewrite_args(
22322232
) -> Option<String> {
22332233
let mut arg_item_strs = args
22342234
.iter()
2235-
.map(|arg| arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent)))
2236-
.collect::<Option<Vec<_>>>()?;
2235+
.map(|arg| {
2236+
arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent))
2237+
.unwrap_or_else(|| context.snippet(arg.span()).to_owned())
2238+
}).collect::<Vec<_>>();
22372239

22382240
// Account for sugary self.
22392241
// FIXME: the comment for the self argument is dropped. This is blocked

0 commit comments

Comments
 (0)