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
borrowed value does not live long enough #22
Comments
never mind, just needed to use unsafe. |
It is a bit unfortunate that unsafe is needed in this seemingly standard use case. I haven't looked at the code yet, but it would seem that some better lifetime management would resolve the issue. Thoughts? |
It's both a limitation of the library and a limitation of Rust. I think the best path for when!(foo.method).then(|_| { mocked_return_object } ) When the closure is given, // made up syntax,I need to give this actual thought
when!(foo.method).return(mocked_return_object) At that point, I have been away from |
Added new methods: c609864 I am still unsure about the names but they will do for now. They should be up on the next release of |
v0.0.6 added |
Looking into this mocking library, still relatively new to rust. Having some issues when trying to mock some object that I have that communicates with a unix socket.
Creating a mock function and this is the following code in my test file.
this is the function that is being mocked.
this is the error when I try and compile the code.
Slightly confused about this error, because of the functions being called normally before trying out this library.
Thanks for the library, just need some explanation on how to fix this code.
The text was updated successfully, but these errors were encountered: