Content
@
https://www.rust-lang.org
0 reply
0 recast
0 reaction
Brenner
@brenner.eth
Does any one have a pattern they like when using prost and sqlx? Specifically for enums? I want to go from proto enum -> rust enum -> sql enum without having to manually write conversions, or call `to_string()` on my enums I'm using tonic_build / prost_build Any ideas?
2 replies
0 recast
2 reactions
Yousuf Haque
@yousufhaque.eth
Have you looked at from/into? Seems like it might work for you https://doc.rust-lang.org/rust-by-example/conversion/from_into.html
1 reply
0 recast
0 reaction
Brenner
@brenner.eth
Yeah this is what we do rn but I’m trying not have to have 2 different structs for every enum
0 reply
0 recast
0 reaction