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

Add ? usage example to error handling #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Jun 26, 2023

No description provided.

@fmoletta fmoletta marked this pull request as ready for review June 26, 2023 15:57
Comment on lines +185 to +186
let average_speed = average_speed_as_felt(0, 20); // This will return Result::Err('Zero Division Error')
let average_speed = average_speed_as_felt(2, 20); // This will return Result::Ok(10)
Copy link
Contributor

@MegaRedHand MegaRedHand Jul 3, 2023

Choose a reason for hiding this comment

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

We could use an assert here instead of a comment. That way the example is self-testing.

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