-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove crash! macro #7084
Remove crash! macro #7084
Conversation
Can you please run |
Sorry, yesterday I forgot to run cargo fmt. I've fixed the formatting and removed the doc comments linking to the deleted macros. |
543d94b
to
03a325f
Compare
GNU testsuite comparison:
|
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 |
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.
A detail:
//! - Terminate util execution |
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
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.
With the exception of a minor detail it looks good :)
GNU testsuite comparison:
|
Thanks for your PR :) |
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.