clickhouse-rs
clickhouse-rs copied to clipboard
Implement `TryFrom` rather than `From` for fallible conversions
This crate provides methods for converting from the Value enum into many native Rust types. These conversions are generally done these with the From trait, for example From<Value> for u64. However, such conversions are not infallible. Instead, should the Value variant not be convertible to T, the crate chooses to panic. The preferred approach in this case is to use TryFrom, which allows the crate's consumer to decide how to handle failures.
I'm happy to help add the relevant TryFrom implementations, but I would defer to the author as to how to handle the existing From implementations.