edgedb / edgedb-rust

The official Rust binding for EdgeDB
https://edgedb.com
Apache License 2.0
214 stars 26 forks source link

Extra impls for Value enum #268

Closed Dhghomon closed 1 year ago

Dhghomon commented 1 year ago

Background: I'm putting together some Rust code samples for the documentation today and one of them includes a global value which has to be a Uuid. Making that is a bit unwieldly, involving bringing in the uuid crate and parsing from a str, and feels like something better handled with a method for Value that does the same.

On top of that I noticed a small PR to add From for Value and I think adding f32 and f64 makes sense here too. There are some others that might be nice like i8 and unsigned integers but not entirely sure if it would create issues with expected vs. received so won't put those in just yet.

Also moved some code around for readability, especially when matching on Value.