Wrap inlined closures in parens when inlined in an expression in inline_call

This commit is contained in:
Lukas Wirth 2021-07-05 15:34:01 +02:00
parent 2579dc6d82
commit dafbe6940e
3 changed files with 68 additions and 8 deletions

View file

@ -1,4 +1,7 @@
//! Handle syntactic aspects of inserting a new `use`.
#[cfg(test)]
mod tests;
use std::cmp::Ordering;
use hir::Semantics;
@ -378,5 +381,3 @@ fn is_inner_comment(token: SyntaxToken) -> bool {
ast::Comment::cast(token).and_then(|comment| comment.kind().doc)
== Some(ast::CommentPlacement::Inner)
}
#[cfg(test)]
mod tests;