momentohq/client-sdk-rust

Audit usage of `From` vs `TryFrom` implementations

Closed this issue · 0 comments

I think there are some response types (e.g. list length, item get ttl, and item get type) that can use into() instead of try_into() but are missing the From implementations

Also Dylan had good feedback:

Hey, I apparently missed this, sorry about that - but from something I was just looking into I noticed there are some places where we're calling .expect in our SDK, e.g. here/here

We should probably be returning an error via the Result type instead, and leaving it up to the user to decide if their application should panic in response

I'd consider adding -W clippy::expect_used to your lint and then using #[allow(clippy::expect_used)] to exempt usages if you have a legitimate reason