-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(corelib): OptionTrait::ok_or_else #6930
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @julio4)
corelib/src/option.cairo
line 208 at r1 (raw file):
+Destruct<E>, impl func: core::ops::FnOnce<F, ()>[Output: E], +Drop<func::Output>,
Suggestion:
E,
F,
+core::ops::FnOnce<F, ()>[Output: E],
+Destruct<E>,
+Drop<F>,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julio4 can you add the module-level docs, in the # Methods Overview for the new functions you introduce in the Option
(or Result
) please 🙏
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @julio4 and @orizi)
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @julio4)
a discussion (no related file):
@TomerStarkware for 2nd eye.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @julio4)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @julio4)
a discussion (no related file):
just waiting for @enitrat 's approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @julio4)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @julio4)
Transforms the
Option<T>
into aResult<T, E>
, mappingOption::Some(v)
toResult::Ok(v)
andOption::None
toResult::Err(err())
.Also add missing tests for
OptionTrait::ok_or
Examples