Skip to content

Commit 060f8f9

Browse files
yangdanny97facebook-github-bot
authored andcommitted
use unwrap_or_else
Summary: more concise Reviewed By: rchen152 Differential Revision: D75472201 fbshipit-source-id: f84287edc06a8445ed11725e4de29a427f03082b
1 parent 27bf9ea commit 060f8f9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pyrefly/lib/binding/scope.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,7 @@ impl Scopes {
748748
}
749749
Entry::Occupied(mut e) => {
750750
let default = if in_loop { Some(e.get().default) } else { None };
751-
let style = if let Some(style) = style {
752-
style
753-
} else {
754-
e.get().style.clone()
755-
};
751+
let style = style.unwrap_or_else(|| e.get().style.clone());
756752
*e.get_mut() = FlowInfo {
757753
key,
758754
default: default.unwrap_or(key),

0 commit comments

Comments
 (0)