Remove crash! macro#7084
Merged
cakebaker merged 1 commit intouutils:mainfrom Jan 8, 2025
saulvaldelvira:main
Merged
Conversation
Contributor
|
Can you please run |
Contributor
Author
Sorry, yesterday I forgot to run cargo fmt. I've fixed the formatting and removed the doc comments linking to the deleted macros. |
|
GNU testsuite comparison: |
cakebaker
reviewed
Jan 7, 2025
src/uucore/src/lib/macros.rs
Outdated
| @@ -31,7 +31,6 @@ | |||
| //! - From custom messages: [`crate::show_error!`] | |||
| //! - Print warnings: [`crate::show_warning!`] | |||
| //! - Terminate util execution | |||
Contributor
There was a problem hiding this comment.
A detail:
Suggested change
| //! - Terminate util execution |
cakebaker
reviewed
Jan 7, 2025
Contributor
cakebaker
left a comment
There was a problem hiding this comment.
With the exception of a minor detail it looks good :)
|
GNU testsuite comparison: |
Contributor
|
Thanks for your PR :) |
jfinkels
added a commit
that referenced
this pull request
Jan 10, 2025
The `crash!` macro has been removed in #7084
sylvestre
pushed a commit
that referenced
this pull request
Jan 10, 2025
The `crash!` macro has been removed in #7084
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.
Remove the crash! and crash_if_error! macros, as discussed in #5487 .
I've replaced all crash_if_err! macro calls, by changing the return type of the functions it was called on. Instead of returning T, they return UResult<T>.
This way, instead of crashing, we can propagate the error.
The prompt_yes! macro also used crash_if_err!. In this case, I've replaced that with a call to show_if_err!.
All test pass, except test_df::test_type_option_with_file, which already failed before the changes.
NOTE: This is my first time contributing. Hope I've done everything alright.