diff --git a/lib/speedy-uuid/src/lib.rs b/lib/speedy-uuid/src/lib.rs index 7b4fa74b0..5351014c9 100644 --- a/lib/speedy-uuid/src/lib.rs +++ b/lib/speedy-uuid/src/lib.rs @@ -6,6 +6,9 @@ use std::{ use thiserror::Error; use uuid_simd::{format_hyphenated, AsciiCase, Out, UuidExt}; +#[cfg(feature = "diesel")] +use diesel::{deserialize::FromSqlRow, expression::AsExpression}; + pub use uuid; #[derive(Debug, Error)] @@ -17,10 +20,7 @@ pub enum Error { Uuid(#[from] uuid::Error), } -#[cfg_attr( - feature = "diesel", - derive(diesel::expression::AsExpression, diesel::deserialize::FromSqlRow) -)] +#[cfg_attr(feature = "diesel", derive(AsExpression, FromSqlRow))] #[cfg_attr(feature = "diesel", diesel(sql_type = diesel::sql_types::Uuid))] #[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] #[repr(transparent)]