From ad903e08fdaac65a7567c952a1191a14413ec00d Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Thu, 30 Aug 2018 23:39:39 +0900 Subject: [PATCH] Keep formatting fn even if there is an unformattable argument --- src/items.rs | 6 ++++-- 1 file 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 { let mut arg_item_strs = args .iter() - .map(|arg| arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent))) - .collect::>>()?; + .map(|arg| { + arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent)) + .unwrap_or_else(|| context.snippet(arg.span()).to_owned()) + }).collect::>(); // Account for sugary self. // FIXME: the comment for the self argument is dropped. This is blocked