surrealdb-sql 1.1.0

Full type definitions for the SurrealQL query language
Documentation
use crate::array::Array;
use crate::value::Value;

impl Value {
	pub fn flatten(self) -> Self {
		match self {
			Value::Array(v) => {
				v.0.into_iter()
					.flat_map(|v| match v {
						Value::Array(v) => v,
						_ => Array::from(v),
					})
					.collect::<Vec<_>>()
					.into()
			}
			v => v,
		}
	}
}