This seems like a pretty common situation:
switch user {
| Some(x) => Js.log(x)
| None => Js.log(None)
}
What is best practice for naming “x” inside Some?
Just shadow user?
switch user {
| Some(user) => Js.log(user)
| None => Js.log(None)
}
Modify user with something like “user_” (which I think I saw someplace, rust maybe?),
switch user {
| Some(user_) => Js.log(user_)
| None => Js.log(None)
}
Or just something simple like “u” if the scope is very small?
switch user {
| Some(u) => Js.log(u)
| None => Js.log(None)
}