From dd5ed5393098dc4a39558f119d7a2d862dc211ae Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Sat, 7 Oct 2017 22:01:44 +0900 Subject: [PATCH] Remove calling rewrite() against String --- src/expr.rs | 4 +--- src/types.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index f41feb52631e..dbaf1cceefc6 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -718,9 +718,7 @@ fn rewrite_closure_block( if block_str.matches('\n').count() <= block_threshold as usize && !need_block_indent(&block_str, shape) { - if let Some(block_str) = block_str.rewrite(context, shape) { - return Some(format!("{} {}", prefix, block_str)); - } + return Some(format!("{} {}", prefix, block_str)); } } } diff --git a/src/types.rs b/src/types.rs index c17112c94047..1b70b5448d9f 100644 --- a/src/types.rs +++ b/src/types.rs @@ -550,7 +550,7 @@ impl Rewrite for ast::TyParamBounds { let strs = self.iter() .map(|b| b.rewrite(context, shape)) .collect::>>()?; - join_bounds(context, shape, &strs).rewrite(context, shape) + Some(join_bounds(context, shape, &strs)) } }