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
clippy: Map to an error type instead of using allowing result_unit_err
in components/url
#31834
Conversation
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.
Some points:
- When you receive feedback in a PR, just update the old one, don't create a new one
- The only difference from cd28798 is that you avoided inserting a space before
#![deny(unsafe_code)]
, but you are still adding unnecessary newlines - Is there any reason to reorder the methods?
- The template for pull requests has a list of things that you need to test, and check if they hold.
- In particular,
./mach test-tidy
is complaining: https://github.com/servo/servo/actions/runs/8395608656/job/22995237911?pr=31834 - What are the warnings that you are trying to address?
Thankyou for your feedback. I will address the issues mentioned. In the above PR, I used a custom error type to address the warnings of functions returning 'Result<_, ()>'. |
@Loirooriol |
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.
What's the reason for reordering the methods?
Methods have been reordered to align with the new error handling strategy. The methods which use custom error UrlError have been put together to enhance readability of the code. Would you want me to reorder them ? |
Co-authored-by: eri <eri@inventati.org>
result_unit_err
in components/url
🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync. |
Looks like I was wrong here. This didn't go to the merge queue, because it is still waiting on a review from @Loirooriol, as he requested changes earlier. |
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.
I share eerii's doubts about whether this is actually an improvement, but I'm fine with the change.
I also agree that as it is, this isn't super useful, but it does prepare the code for better error handling in the future. |
Looks like the failure was an infrastructure issue for the Android build:
|
…err` in `components/url` (servo#31834) * clippy: fix warnings in components/url * Fix code formatting issues in components/url/lib.rs * Update components/url/lib.rs Co-authored-by: eri <eri@inventati.org> * made requested changes --------- Co-authored-by: Ekta Siwach <ektasiwach@Ektas-MacBook-Air.local> Co-authored-by: eri <eri@inventati.org>
./mach build -d
does not report any errors./mach test-tidy
does not report any errors