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

docs: Improve documentation for Result #14

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

skarllot
Copy link
Contributor

  • Categorize operators documentation for Result
  • Add missing documentation for Result operators

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


### UnwrapEither

The `UnwrapEither` returns either the value or the error when `Result` value type is the same of error type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


### UnwrapErr

The `UnwrapErr` gets the `Err` value, or throws an exception otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `UnwrapErr` gets the `Err` value, or throws an exception otherwise.
The `UnwrapErr` method gets the `Err` value, or throws an exception otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -27,6 +31,197 @@ else
}
```

### Unwrap

The `Unwrap` / `UnwrapOrThrow` gets the `Ok` value, or throws an exception otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jeffijoe jeffijoe merged commit e0f0f2e into taxfyle:main Jun 23, 2024
2 checks passed
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