Skip to content
Discussion options

You must be logged in to vote

This isn't a Mockall problem. It's just a usual Rust lifetime issue. You need withf to own its argument. You can do that by using clone. Or you can construct a new object within the closure itself. Or you can make MyData a global constant. Or you can examine the data field by field within withf. Or you can make use of Arc<Mutex<_>>. There are lots of solutions.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@StephanVogt
Comment options

@asomers
Comment options

@StephanVogt
Comment options

@asomers
Comment options

Answer selected by StephanVogt
@StephanVogt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants