surrealpatch/lib/src/sql/value/single.rs
2022-05-04 23:37:57 +01:00

13 lines
202 B
Rust

use crate::sql::value::Value;
impl Value {
pub fn single(&self) -> &Self {
match self {
Value::Array(v) => match v.first() {
None => &Value::None,
Some(v) => v,
},
v => v,
}
}
}