Skip to content
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

Require destruct instead of drop for unwrapping. #5902

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

ilyalesokhin-starkware
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware commented Jun 26, 2024

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 3 files at r1, all commit messages.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


corelib/src/result.cairo line 15 at r1 (raw file):

pub impl ResultTraitImpl<T, E> of ResultTrait<T, E> {
    /// If `val` is `Result::Ok(x)`, returns `x`. Otherwise, panics with `err`.
    fn expect<+Destruct<E>>(self: Result<T, E>, err: felt252) -> T {

probably - and probably everywhere that panics elsewhere.

Suggestion:

    fn expect<+PanicDestruct<E>>(self: Result<T, E>, err: felt252) -> T {

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

@ilyalesokhin-starkware
Copy link
Contributor Author

corelib/src/result.cairo line 15 at r1 (raw file):

Previously, orizi wrote…

probably - and probably everywhere that panics elsewhere.

Done

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Jun 27, 2024
Merged via the queue into dev-v2.7.0 with commit 80fadf8 Jun 27, 2024
42 of 43 checks passed
@orizi orizi deleted the ilya/unwrap branch July 1, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants