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

11 lines
169 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) => v.first().unwrap_or(&Value::None),
2022-04-01 22:28:54 +00:00
v => v,
}
}
}