From 50fa0843ae813fa303c700ac81d764ce467d926d Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 23 Oct 2022 23:21:21 +0800 Subject: [PATCH] Qualify DbErr --- sea-orm-macros/src/derives/active_model.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sea-orm-macros/src/derives/active_model.rs b/sea-orm-macros/src/derives/active_model.rs index eed3dac0..43efe6b6 100644 --- a/sea-orm-macros/src/derives/active_model.rs +++ b/sea-orm-macros/src/derives/active_model.rs @@ -194,10 +194,10 @@ fn derive_into_model(model_fields: IntoIter) -> syn::Result Ok(quote!( #[automatically_derived] impl std::convert::TryFrom for ::Model { - type Error = DbErr; - fn try_from(a: ActiveModel) -> Result { + type Error = sea_orm::DbErr; + fn try_from(a: ActiveModel) -> Result { #(if matches!(a.#active_model_field, sea_orm::ActiveValue::NotSet) { - return Err(DbErr::AttrNotSet(stringify!(#active_model_field).to_owned())); + return Err(sea_orm::DbErr::AttrNotSet(stringify!(#active_model_field).to_owned())); })* Ok( Self { @@ -209,7 +209,7 @@ fn derive_into_model(model_fields: IntoIter) -> syn::Result #[automatically_derived] impl sea_orm::TryIntoModel<::Model> for ActiveModel { - fn try_into_model(self) -> Result<::Model, DbErr> { + fn try_into_model(self) -> Result<::Model, sea_orm::DbErr> { self.try_into() } }