coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

Implement TryFromIntError conversion for AnchorError #2950

Closed CanardMandarin closed 1 month ago

CanardMandarin commented 1 month ago

I noticed it was a bit painful to cast integers with try_into and try_from because you have to either unwrap() or map_err(||).

What about implementing TryFromIntError for Error so we can use the ? operator?

vercel[bot] commented 1 month ago

@CanardMandarin is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

CanardMandarin commented 1 month ago

Sure! I have added a test case.

CanardMandarin commented 1 month ago

My bad, I should have thought about it!

CanardMandarin commented 1 month ago

Feel free to modify the changelog entry if the description is not clear.