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
faux::methods
bug on recognizing types
#51
Comments
🤦🏾 this is due to me doing a very silly check when trying to check if the returned type includes the mocked struct: faux/faux_macros/src/methods/morphed.rs Lines 255 to 262 in 709e053
This checks if any part of the return type includes the word "Self" or the name as the struct. In this case the return type I will try to get a fix out in the coming days for this but in the meantime a type alias somewhere in the module should fix this.
and then in the function signature |
Same behavior with an |
@nrxus Great! Thx for the quick response. I've implemented another workaround and combined two methods in one, but your workaround is much better. I don't close the issue so that you can close it when submitting the fix! Thx again! |
@nrxus Any news regarding the fix? |
@schneidersteve I've unfortunately been too swamped between work and life to take a stab at a fix yet. I am hoping to come back to faux soon since there are quite a few improvements I want to make including this fix. In the meantime though, I am always open for PRs 😄 |
Fixed in 6aa254a which I just released as v0.1.10. Hopefully this addresses the issues but please let me know if something is still wonky. |
Hi! Ive been implementing faux to mock some structs but I'm stuck in an error that i can not work it out. Hope you can help me out with this. The issue is that the compiler is throwing an error due to the return type. The error is below:
the return type refers to the mocked struct in a way that faux cannot handle. Split this function into an
implblock not marked by #[faux::methods]. If you believe this is a mistake or it's a case that should be handled by faux please file an issue
Here below is the code. The issue is on
Redis::run
function but this function doesn't return a type that refers to the mocked struct, it just returns()
:That's all, hope you can help me.
The text was updated successfully, but these errors were encountered: