[BREAKING CHANGES] Rename Ok,Err and Remove :Result attribute and more.#2
Merged
[BREAKING CHANGES] Rename Ok,Err and Remove :Result attribute and more.#2
Ok,Err and Remove :Result attribute and more.#2Conversation
1. Rename `Ok`,`Err` to `ok`,`err`
- naming to better align with Perl conventions.
2. Remove :Result attribute, Added `result_for` function
- `use Result::Simple qw(ok err)` fails to import :Result attribute
- It is hard to control attribute, so added just result_for
function.
3. Use @EXPORT_OK to export `ok`, `err` and `result_for`
Pull Request Test Coverage Report for Build 14531989382Details
💛 - Coveralls |
kfly8
added a commit
that referenced
this pull request
Apr 18, 2025
Changelog diff is: diff --git a/Changes b/Changes index 48f3529..aab3655 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,15 @@ Revision history for Perl extension Result-Simple {{$NEXT}} +0.04 2025-04-18T22:53:43Z + - [BREAKING CHANGES] + - Renamed `Ok` to `ok`, `Err` to `err` #2 + - Removed `:Result` attribute, instead added `result_for` function #2 + - Changed default value of `$ENV{RESULT_SIMPLE_CHECK_ENABLED}` to `1` #2 + - [ENHANCEMENTS] + - Added `unsafe_unwrap` and `unsafe_unwrap_err` functions #2 + - Added `chain` and `pipeline` helper functions #3 + 0.03 2024-11-27T01:18:40Z - Improve docs #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull requests produces these things:
Ok,Errtook,errresult_forfunctionok,errandresult_for$ENV{RESULT_SIMPLE_CHECK_ENABLED}1. Rename
Ok,Errtook,errI think
OkandErrdoes not align perl conventions. In perl, we usually use snake case. So I renamed function names.2. Remove :Result attribute, Added
result_forfunctionIt is hard to control attribute and it has bugs like this:
So, I added
result_forfunction, it is simple wrapper for function:3. Use @EXPORT_OK to export
ok,errandresult_forIt would be better to specify which functions are to be imported.
4. Change default value of
$ENV{RESULT_SIMPLE_CHECK_ENABLED}Changed to check values by default. Whatever the initial value, it is better to specify this environment variable in the production environment to prevent unexpected accidents.
5. Added unsafe_unwrap, unsafe_unwrap_err
These are utility test functions.
6. Added alias features