refinement
refinement copied to clipboard
Add a constructor `Refinement::try_new`
Add a constructor Refinement::try_new that returns the original input value if it does not satisfy the predicate, rather than discarding the input value in that case as does Refinement::new.
This could be useful if the input value is expensive or impossible to reconstruct and is wanted even if it does not satisfy the predicate (for example, to report an error).
I believe this change raises the library's minimum supported Rust version (MSRV) from 1.31 to 1.34. Rust 1.34 is supported by distributions including Debian oldoldstable.