This started because I was using a Result type that did not implement Clone (anyhow::Result, not super uncommon, I gather :) ). The first commit makes using a Result like that possible.
Then I figured why even store the Result/Option, if we can just store the value and re-wrap before returning. That is the second commit.
Added a test for Option, and made both Option and Result tests a little more challenging.
This started because I was using a Result type that did not implement Clone (
anyhow::Result
, not super uncommon, I gather :) ). The first commit makes using a Result like that possible.Then I figured why even store the Result/Option, if we can just store the value and re-wrap before returning. That is the second commit.
Added a test for Option, and made both Option and Result tests a little more challenging.