It should be easier to set/return !Maybe than `Nothing()`
Categories
(Core :: MFBT, defect, P3)
Tracking
()
People
(Reporter: jgilbert, Assigned: jgilbert)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
Previously we could return {};
to indicate !Maybe.
Now we must generally return Nothing();
, which is both more characters (visual load) and looks like a function call (cognitive load).
Assignee | ||
Comment 1•5 years ago
|
||
using
std::nullopt as mozilla::nullopt, a la nullptr.
E.g. instead of maybe = Nothing()
, just maybe = nullopt
or maybe = {}
.
Comment 2•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 3•5 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:jgilbert, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•5 years ago
|
Just thought about this:
(In reply to Jeff Gilbert [:jgilbert] from comment #0)
return Nothing();
, which ... looks like a function call (cognitive load).
Note that you could write return Nothing{};
(with curly braces) to avoid the function call look. 😉 But yes it's still 7 more characters than {}
alone.
Assignee | ||
Comment 5•5 years ago
|
||
I know, but thanks! That's not my priority here.
Updated•5 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•