collapse nested if detected by clippy
This commit is contained in:
parent
76ef162af7
commit
c97996fab6
10
src/types.rs
10
src/types.rs
@ -682,10 +682,12 @@ impl Rewrite for ast::Ty {
|
|||||||
};
|
};
|
||||||
let mut res = bounds.rewrite(context, shape)?;
|
let mut res = bounds.rewrite(context, shape)?;
|
||||||
// We may have falsely removed a trailing `+` inside macro call.
|
// We may have falsely removed a trailing `+` inside macro call.
|
||||||
if context.inside_macro() && bounds.len() == 1 {
|
if context.inside_macro()
|
||||||
if context.snippet(self.span).ends_with('+') && !res.ends_with('+') {
|
&& bounds.len() == 1
|
||||||
res.push('+');
|
&& context.snippet(self.span).ends_with('+')
|
||||||
}
|
&& !res.ends_with('+')
|
||||||
|
{
|
||||||
|
res.push('+');
|
||||||
}
|
}
|
||||||
Some(format!("{prefix}{res}"))
|
Some(format!("{prefix}{res}"))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user