diff --git a/partiql-types/Cargo.toml b/partiql-types/Cargo.toml index 72ed1144..c672bfc6 100644 --- a/partiql-types/Cargo.toml +++ b/partiql-types/Cargo.toml @@ -29,6 +29,6 @@ thiserror = "1" indexmap = "2.5" -derivative = "2.2" +educe = "0.6" [dev-dependencies] diff --git a/partiql-types/src/lib.rs b/partiql-types/src/lib.rs index 8437611d..fdd63008 100644 --- a/partiql-types/src/lib.rs +++ b/partiql-types/src/lib.rs @@ -1,7 +1,7 @@ #![deny(rust_2018_idioms)] #![deny(clippy::all)] -use derivative::Derivative; +use educe::Educe; use indexmap::IndexSet; use itertools::Itertools; use miette::Diagnostic; @@ -584,11 +584,11 @@ impl PartiqlShapeBuilder { } } -#[derive(Derivative, Eq, Debug, Clone)] -#[derivative(PartialEq, Hash)] +#[derive(Educe, Eq, Debug, Clone)] +#[educe(PartialEq, Hash)] #[allow(dead_code)] pub struct AnyOf { - #[derivative(Hash(hash_with = "indexset_hash"))] + #[educe(Hash(method(indexset_hash)))] types: IndexSet, } @@ -743,11 +743,11 @@ impl Display for Static { pub const TYPE_DYNAMIC: PartiqlShape = PartiqlShape::Dynamic; -#[derive(Derivative, Eq, Debug, Clone)] -#[derivative(PartialEq, Hash)] +#[derive(Educe, Eq, Debug, Clone)] +#[educe(PartialEq, Hash)] #[allow(dead_code)] pub struct StructType { - #[derivative(Hash(hash_with = "indexset_hash"))] + #[educe(Hash(method(indexset_hash)))] constraints: IndexSet, } @@ -827,15 +827,15 @@ impl Display for StructType { } } -#[derive(Derivative, Eq, Debug, Clone)] -#[derivative(PartialEq, Hash)] +#[derive(Educe, Eq, Debug, Clone)] +#[educe(PartialEq, Hash)] #[allow(dead_code)] #[non_exhaustive] pub enum StructConstraint { Open(bool), Ordered(bool), DuplicateAttrs(bool), - Fields(#[derivative(Hash(hash_with = "indexset_hash"))] IndexSet), + Fields(#[educe(Hash(method(indexset_hash)))] IndexSet), } #[derive(Debug, Clone, Hash, Eq, PartialEq)] @@ -901,8 +901,8 @@ impl From<(&str, PartiqlShape, bool)> for StructField { } } -#[derive(Derivative, Eq, Debug, Clone)] -#[derivative(PartialEq, Hash)] +#[derive(Educe, Eq, Debug, Clone)] +#[educe(PartialEq, Hash)] #[allow(dead_code)] pub struct BagType { element_type: Box, @@ -938,8 +938,8 @@ impl Display for BagType { } } -#[derive(Derivative, Eq, Debug, Clone)] -#[derivative(PartialEq, Hash)] +#[derive(Educe, Eq, Debug, Clone)] +#[educe(PartialEq, Hash)] #[allow(dead_code)] pub struct ArrayType { element_type: Box,