Skip to content

Commit cc6512c

Browse files
committed
Re-ran cargo dev fmt to fix line length issues
1 parent 6608be1 commit cc6512c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

clippy_lints/src/option_if_let_else.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ fn is_result_ok(cx: &LateContext<'_, '_>, expr: &'_ Expr<'_>) -> bool {
8888
/// this function returns Some(Option<_> tested against, the method to call on
8989
/// the object (map_or or map_or_else), expression if Option is Some,
9090
/// expression if Option is None). Otherwise, it returns None.
91-
fn detect_option_if_let_else<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr<'_>) -> Option<(String, String, String, String)> {
91+
fn detect_option_if_let_else<'a>(
92+
cx: &LateContext<'_, '_>,
93+
expr: &'a Expr<'_>,
94+
) -> Option<(String, String, String, String)> {
9295
if_chain! {
9396
if let ExprKind::Match(let_body, arms, MatchSource::IfLetDesugar{contains_else_clause: true}) = &expr.kind;
9497
if arms.len() == 2;
@@ -102,7 +105,8 @@ fn detect_option_if_let_else<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr<'_>) -
102105
} else {
103106
(arms[1].body, arms[0].body)
104107
};
105-
let some_body = if let ExprKind::Block(Block { stmts: statements, expr: Some(expr), .. }, _) = &some_body.kind {
108+
let some_body = if let ExprKind::Block(Block { stmts: statements, expr: Some(expr), .. }, _)
109+
= &some_body.kind {
106110
if let &[] = &statements {
107111
expr
108112
} else {
@@ -122,7 +126,8 @@ fn detect_option_if_let_else<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr<'_>) -
122126
} else {
123127
return None;
124128
};
125-
let (none_body, method_sugg) = if let ExprKind::Block(Block { stmts: statements, expr: Some(expr), .. }, _) = &none_body.kind {
129+
let (none_body, method_sugg) = if let ExprKind::Block(Block { stmts: statements, expr: Some(expr), .. }, _)
130+
= &none_body.kind {
126131
if let &[] = &statements {
127132
(expr, "map_or")
128133
} else {

0 commit comments

Comments
 (0)