-
Notifications
You must be signed in to change notification settings - Fork 2
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
docs: Improve documentation for Result #14
Conversation
skarllot
commented
Jun 22, 2024
- Categorize operators documentation for Result
- Add missing documentation for Result operators
docs/core/result.md
Outdated
int resultValue = result.Unwrap("Optional error message"); | ||
``` | ||
|
||
Or you can use `UnwrapOr` / `UnwrapOrElse` and specify a fallback value for when result is in error state. |
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.
Or you can use `UnwrapOr` / `UnwrapOrElse` and specify a fallback value for when result is in error state. | |
Or you can use `UnwrapOr` / `UnwrapOrElse` and specify a fallback value for when the result is in the error state. |
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.
Done.
docs/core/result.md
Outdated
|
||
### UnwrapEither | ||
|
||
The `UnwrapEither` returns either the value or the error when `Result` value type is the same of error type. |
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.
The `UnwrapEither` returns either the value or the error when `Result` value type is the same of error type. | |
The `UnwrapEither` method returns either the Ok value or the Err value when both are of the same type. |
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.
Done.
docs/core/result.md
Outdated
|
||
### UnwrapErr | ||
|
||
The `UnwrapErr` gets the `Err` value, or throws an exception otherwise. |
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.
The `UnwrapErr` gets the `Err` value, or throws an exception otherwise. | |
The `UnwrapErr` method gets the `Err` value, or throws an exception otherwise. |
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.
Done.
docs/core/result.md
Outdated
@@ -27,6 +31,197 @@ else | |||
} | |||
``` | |||
|
|||
### Unwrap | |||
|
|||
The `Unwrap` / `UnwrapOrThrow` gets the `Ok` value, or throws an exception otherwise. |
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.
The `Unwrap` / `UnwrapOrThrow` gets the `Ok` value, or throws an exception otherwise. | |
The `Unwrap` / `UnwrapOrThrow` methods get the `Ok` value, or throw an exception otherwise. |
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.
Done.