Closed
Bug 1325073
Opened 9 years ago
Closed 8 years ago
Make a shorter version for constructing error values of Result<V,E>
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: nbp, Assigned: nbp)
Details
Attachments
(1 file)
6.49 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
To construct an error value today, we have to use either the constructor of the Result<V,E>, or to use the GenericErrorResult<E>.
In IonBuilder (Bug 1286505) we have multiple Ok types, but a single generic error type, in which case making such error is made verbose by the function
mozilla::MakeGenericErrorResult
I suggest to rename this function to
mozilla::Err
In order to follow the same naming as Rust code, and in the continuity of the Ok() constructor.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8820717 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → nicolas.b.pierron
Status: NEW → ASSIGNED
Comment 2•8 years ago
|
||
Comment on attachment 8820717 [details] [diff] [review]
Rename mozilla::MakeGenericErrorResult to mozilla::Err.
Review of attachment 8820717 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/Ion.h
@@ +40,5 @@
>
> template <typename V>
> using AbortReasonOr = mozilla::Result<V, AbortReason>;
> using mozilla::Ok;
> +using mozilla::Err;
This should go before Ok for alphabetical purposes.
::: mfbt/tests/TestResult.cpp
@@ +6,5 @@
>
> #include "mozilla/Result.h"
>
> using mozilla::GenericErrorResult;
> +using mozilla::Err;
E before G, so move this one line earlier.
Attachment #8820717 -
Flags: review?(jwalden+bmo) → review+
Pushed by npierron@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3ec4fd0c06c9
Rename mozilla::MakeGenericErrorResult to mozilla::Err. r=Waldo
Comment 4•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•