Open Bug 1626699 Opened 5 years ago Updated 3 years ago

It should be easier to set/return !Maybe than `Nothing()`

Categories

(Core :: MFBT, defect, P3)

defect

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).

using std::nullopt as mozilla::nullopt, a la nullptr.
E.g. instead of maybe = Nothing(), just maybe = nullopt or maybe = {}.

See Also: → 1625463

Bugbug thinks this bug is a defect, but please change it back in case of error.

Type: task → defect
Type: defect → task

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.

Flags: needinfo?(jgilbert)
Flags: needinfo?(jgilbert)

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.

I know, but thanks! That's not my priority here.

Has Regression Range: --- → yes
Keywords: regression
Severity: normal → S3
Type: task → defect
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: