-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Replace unsugar_if
function with is_if
function
#4230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We should just remove it -- it was useful when if and if let used different ASTs, but it's not anymore, you can just match on the if. |
if let Some((then, &Some(ref else_))) = unsugar_if(expr); | ||
if is_block(else_) || unsugar_if(else_).is_some(); | ||
if let ExprKind::If(_, then, Some(else_)) = &expr.node; | ||
if is_block(else_) || is_if(else_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple occurences of this function in a ||
or &&
expression. Removing this function would make the code way more complicated IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah
@bors r+ fair enough! |
📌 Commit 662037b has been approved by |
Replace `unsugar_if` function with `is_if` function cc #4123 (comment) changelog: none r? @Manishearth
☀️ Test successful - checks-travis, status-appveyor |
cc #4123 (comment)
changelog: none
r? @Manishearth