-
Notifications
You must be signed in to change notification settings - Fork 117
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
fix(generics): support generic response types #332
Conversation
@mharkins-cosm could you please rebase so we can run the tests with gha? |
Done |
Cool, it's running now. Could you please also add tests for generic response types and also update the changelog? Thanks |
Yes, I will. I'm sorry I haven't had time to get to it yet. It's on my todo list! |
@tiagolobocastro Finally got to adding the requested test and changelog. Would you mind having a look and kicking of the checks if it looks good to you? |
saw the lint check failed. i think i should have that fixed now. |
macros/src/actix.rs
Outdated
vec![#(#type_params::name()),*] | ||
.iter() | ||
.filter(|n| n.is_some()) | ||
.map(|n| n.as_ref().unwrap().clone()).collect::<Vec<String>>() |
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.
could use filter_map here? also maybe into_iter instead of iter avoiding having to write the clone?
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.
hmmm... i get a warning for into_iter
, but can use filter_map
.
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.
✅
cool I kicked the GHA, will have a another look tomorrow |
Funny the clippy warning is not part of this PR, nor does it appear to be accurate. Do you want me to add an |
That'd be great if you don't mind 👍 |
Thanks very much @tiagolobocastro ! Any idea when it'll be released, along with the actix 4 support? |
No, thank you! I'll probably try to publish it this weekend. |
This is an attempt to address issue #204. Because the nested generic objects must be checked dynamically for names, I had to get rid of the
NAME
constant and replace it with aname()
method. Then it's just including named type parameter names in the parent name surrounded by angle brackets (<>
).