aerospike-client-rust icon indicating copy to clipboard operation
aerospike-client-rust copied to clipboard

Implement std::convert::TryFrom<aerospike::Value> for each variant

Open austinjones opened this issue 2 years ago • 0 comments

If the aerospike client implemented TryFrom, it would be much easier to unpack Values. It would be much easier to write this:

let field: i64 = value.try_into()?

Rather than this:

let field: i64 = match value {
  Value::Int(v) => Ok(v),
  _ => Err(CustomError::InvalidType)
 }?;

austinjones avatar Jun 20 '22 19:06 austinjones