From d58625648f4e27b831ebb7eecd12fb36df3fba4e Mon Sep 17 00:00:00 2001 From: Amr Hesham Date: Tue, 21 May 2024 21:19:25 +0200 Subject: [PATCH] collapse nested if detected by clippy --- src/types.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/types.rs b/src/types.rs index 9d6e43c0ba4..1544d2df335 100644 --- a/src/types.rs +++ b/src/types.rs @@ -682,10 +682,12 @@ impl Rewrite for ast::Ty { }; let mut res = bounds.rewrite(context, shape)?; // We may have falsely removed a trailing `+` inside macro call. - if context.inside_macro() && bounds.len() == 1 { - if context.snippet(self.span).ends_with('+') && !res.ends_with('+') { - res.push('+'); - } + if context.inside_macro() + && bounds.len() == 1 + && context.snippet(self.span).ends_with('+') + && !res.ends_with('+') + { + res.push('+'); } Some(format!("{prefix}{res}")) }