Skip to main content

surrealdb_expr/expr/convert/
split.rs

1//! `sql` -> `expr` conversions for [`crate::sql::split`].
2//!
3//! Lives in core rather than beside the AST: `surrealdb-sql` sits below
4//! core, so it cannot name `expr` types.
5
6use crate::sql::split::*;
7
8impl From<Splits> for crate::expr::Splits {
9	fn from(v: Splits) -> Self {
10		Self(v.0.into_iter().map(Into::into).collect())
11	}
12}
13
14impl From<crate::expr::Splits> for Splits {
15	fn from(v: crate::expr::Splits) -> Self {
16		Self(v.0.into_iter().map(Into::into).collect())
17	}
18}
19
20impl From<Split> for crate::expr::Split {
21	fn from(v: Split) -> Self {
22		Self(v.0.into())
23	}
24}
25
26impl From<crate::expr::Split> for Split {
27	fn from(v: crate::expr::Split) -> Self {
28		Self(v.0.into())
29	}
30}