Fix rustfmt according to review

This commit is contained in:
Nadrieril 2024-11-24 22:57:33 +01:00
parent 962c0140c7
commit 483f9e2580
2 changed files with 14 additions and 2 deletions

View file

@ -339,9 +339,9 @@ impl Rewrite for Pat {
.max_width_error(shape.width, self.span)?,
)
.map(|inner_pat| format!("({})", inner_pat)),
PatKind::Err(_) => Err(RewriteError::Unknown),
PatKind::Guard(..) => Ok(context.snippet(self.span).to_string()),
PatKind::Deref(_) => Err(RewriteError::Unknown),
PatKind::Guard(..) => Err(RewriteError::Unknown),
PatKind::Err(_) => Err(RewriteError::Unknown),
}
}
}

View file

@ -0,0 +1,12 @@
#![feature(guard_patterns)]
fn main() {
match user.subscription_plan() {
(Plan::Regular if user.credit() >= 100) | (Plan::Premium if user.credit() >= 80) => {
// Complete the transaction.
}
_ => {
// The user doesn't have enough credit, return an error message.
}
}
}