diff options
| author | Nick Cameron <nrc@ncameron.org> | 2018-08-31 10:43:06 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-31 10:43:06 +1200 |
| commit | d88139893f71801ee7262db999832e6bbab02cc2 (patch) | |
| tree | b8ef3cfe84790c4bb6397ffabf88bfe2db532012 /src | |
| parent | 68015ecf52066bb5d624cda01c580854a042e30f (diff) | |
| parent | ad903e08fdaac65a7567c952a1191a14413ec00d (diff) | |
Merge pull request #2981 from topecongiro/issue-2956
Keep formatting fn even if there is an unformattable argument
Diffstat (limited to 'src')
| -rw-r--r-- | src/items.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/items.rs b/src/items.rs index ff635137e42..7f8980dd150 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2232,8 +2232,10 @@ fn rewrite_args( ) -> Option<String> { let mut arg_item_strs = args .iter() - .map(|arg| arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent))) - .collect::<Option<Vec<_>>>()?; + .map(|arg| { + arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent)) + .unwrap_or_else(|| context.snippet(arg.span()).to_owned()) + }).collect::<Vec<_>>(); // Account for sugary self. // FIXME: the comment for the self argument is dropped. This is blocked |
