nooberfsh / prusto

A presto/trino client library written in rust.
MIT License
37 stars 23 forks source link

Turn various conversion functions into proper traits and use `strum` to simplify string enums #27

Open abhiaagarwal opened 1 year ago

abhiaagarwal commented 1 year ago

I noticed some from_str impls should be using FromStr trait instead, so I converted them. I additionally simplified some macros since the compiler now knows that all its callers implement FromStr.

Figuring out how to turn set_header! into a pure function as well, but since it takes Optional which doesn't have a FromStr impl, will have to think of a relatively clever solution.

abhiaagarwal commented 1 year ago

I'm marking this as "Draft" because I'm doing a little bit of a larger refactoring.

abhiaagarwal commented 1 year ago

Slightly expanded the scope of this to include From / TryFrom, but should be ready for review