review comments

This commit is contained in:
Esteban Küber 2019-10-08 09:46:57 -07:00
parent ac9025c197
commit d0eea6ff6d
2 changed files with 5 additions and 9 deletions

View file

@ -1555,15 +1555,11 @@ impl Expr {
/// `ExprKind` of any given `Expr` for presentation don't have to care about `DropTemps`
/// beyond remembering to call this function before doing analysis on it.
pub fn peel_drop_temps(&self) -> &Self {
let mut base_expr = self;
loop {
match &base_expr.kind {
ExprKind::DropTemps(expr) => {
base_expr = &expr;
}
_ => return base_expr,
}
let mut expr = self;
while let ExprKind::DropTemps(inner) = &expr.kind {
expr = inner;
}
expr
}
}