-
Notifications
You must be signed in to change notification settings - Fork 330
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
Implement Debug for many types #305
Comments
Guideline question: some of these types only exist (or are only public) because the language does not support |
Which types are you considering replacing with |
Since these do exist today, it is reasonable that they implement Debug, right? |
Moving to |
I would be willing to help out with implementing these. Is there anything I would need to know before hopping in? |
Fix #305 Implement Debug for many types For most types it was a simple matter of adding #[derive(Debug)] but ParseOptions needed a manual implementation because the type of log_syntax_violation is Option<&'a Fn(&'static str)> and Fn doesn't implement Debug. log_syntax_violation is formatted as Some(Fn(&'static str)) or None depending upon its value. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/335) <!-- Reviewable:end -->
For most types it was a simple matter of adding #[derive(Debug)] but ParseOptions needed a manual implementation because the type of log_syntax_violation is Option<&'a Fn(&'static str)> and Fn doesn't implement Debug. log_syntax_violation is formatter as Some(Fn(&'static str)) or None depending upon its value.
We generally implement Debug for all types in libraries that are intended for general use.
Add
Debug
for HostAndPort, ParseOptions, PathSegmentsMut, SocketAddrs, UrlQuery, ByteSerialize, Parse, ParseIntoOwned, Serializer,*_ENCODE_SET
, PercentEncode, PercentDecode.The text was updated successfully, but these errors were encountered: