-
Notifications
You must be signed in to change notification settings - Fork 292
ToTokens refactor #754
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
ToTokens refactor #754
Conversation
- value instead of &value.to_string()) when Vec<String> - Vec<String> instead of impl Into<Vec<String>> in a few functions
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.
Looks good. I have some small suggestions for improvement, but nothing blocking. 🎉
@@ -1,3 +1,4 @@ | |||
#![allow(dead_code)] |
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.
Why?
} | ||
} | ||
|
||
enum TypeCode { |
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.
For all these "code" types, I'd really appreciate a doc comment that points out what they are:
/// A struct field
///
/// ```rust
/// struct My Struct {
/// my_field: u32 // <-- refers to this
/// }
/// ```
struct FieldCode {
This is a good milestone for the
ToTokens
refactor. Several new types are created that implement quote::ToTokens. This assists in testing the transform from OpenAPI types. Any types that implementToTokens
can be used directing inquote!
macro. This makes it possible to incrementally refactor out the types.