From f64f1e9216eaee57822ef2071960ff27072d06ec Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 4 Nov 2021 11:01:29 +0800 Subject: [PATCH] `DeriveActiveEnum` generate code that depends on sea-query inside sea-orm --- sea-orm-macros/src/derives/active_enum.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sea-orm-macros/src/derives/active_enum.rs b/sea-orm-macros/src/derives/active_enum.rs index acb60a36..bafb1908 100644 --- a/sea-orm-macros/src/derives/active_enum.rs +++ b/sea-orm-macros/src/derives/active_enum.rs @@ -229,8 +229,8 @@ impl ActiveEnum { #[automatically_derived] #[allow(clippy::from_over_into)] - impl Into for #ident { - fn into(self) -> sea_query::Value { + impl Into for #ident { + fn into(self) -> sea_orm::sea_query::Value { ::to_value(&self).into() } } @@ -244,17 +244,17 @@ impl ActiveEnum { } #[automatically_derived] - impl sea_query::ValueType for #ident { - fn try_from(v: sea_query::Value) -> Result { - let value = <::Value as sea_query::ValueType>::try_from(v)?; - ::try_from_value(&value).map_err(|_| sea_query::ValueTypeErr) + impl sea_orm::sea_query::ValueType for #ident { + fn try_from(v: sea_orm::sea_query::Value) -> Result { + let value = <::Value as sea_orm::sea_query::ValueType>::try_from(v)?; + ::try_from_value(&value).map_err(|_| sea_orm::sea_query::ValueTypeErr) } fn type_name() -> String { - <::Value as sea_query::ValueType>::type_name() + <::Value as sea_orm::sea_query::ValueType>::type_name() } - fn column_type() -> sea_query::ColumnType { + fn column_type() -> sea_orm::sea_query::ColumnType { ::db_type() .get_column_type() .to_owned() @@ -263,9 +263,9 @@ impl ActiveEnum { } #[automatically_derived] - impl sea_query::Nullable for #ident { - fn null() -> sea_query::Value { - <::Value as sea_query::Nullable>::null() + impl sea_orm::sea_query::Nullable for #ident { + fn null() -> sea_orm::sea_query::Value { + <::Value as sea_orm::sea_query::Nullable>::null() } } )