surrealpatch/lib/src/sql/value/single.rs

14 lines
208 B
Rust
Raw Normal View History

2022-04-01 22:28:54 +00:00
use crate::sql::value::Value;
impl Value {
pub fn single(&self) -> &Self {
match self {
Value::Array(v) => match v.value.first() {
None => &Value::None,
Some(v) => v,
},
v => v,
}
}
}