Copy variable in a function

I need to do something like this

fn test(value: T) -> bool { one(value) & two(value) }

This fails with the error use of moved value: value``. I have no control over the type T, so I cannot implement Clone on it. How else can I make this work?

I ended up passing a reference to the function test, I also changed one and two to accept references

1 Like