From 5db910f400b13daa87b5c37dc62fb1da1ff6533d Mon Sep 17 00:00:00 2001 From: laniakea64 Date: Fri, 15 Nov 2024 19:04:10 -0500 Subject: [PATCH] Replace `derivative` with `derive-where` (#2465) --- Cargo.lock | 37 +++++++++++++------------------------ Cargo.toml | 2 +- src/lib.rs | 2 +- src/thunk.rs | 18 +++++++++--------- 4 files changed, 24 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80a7276d..e96dd65b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -237,7 +237,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn", ] [[package]] @@ -329,14 +329,14 @@ dependencies = [ ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive-where" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -531,7 +531,7 @@ dependencies = [ "clap_complete", "clap_mangen", "ctrlc", - "derivative", + "derive-where", "dirs", "dotenvy", "edit-distance", @@ -861,7 +861,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn", ] [[package]] @@ -930,7 +930,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn", ] [[package]] @@ -958,18 +958,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "syn", ] [[package]] @@ -1038,7 +1027,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn", ] [[package]] @@ -1142,7 +1131,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn", "wasm-bindgen-shared", ] @@ -1164,7 +1153,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1396,5 +1385,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn", ] diff --git a/Cargo.toml b/Cargo.toml index f74367d0..c579e2f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ clap = { version = "4.0.0", features = ["derive", "env", "wrap_help"] } clap_complete = "4.0.0" clap_mangen = "0.2.20" ctrlc = { version = "3.1.1", features = ["termination"] } -derivative = "2.0.0" +derive-where = "1.2.7" dirs = "5.0.1" dotenvy = "0.15" edit-distance = "2.0.0" diff --git a/src/lib.rs b/src/lib.rs index 75e3332b..799cc378 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,7 +34,7 @@ pub(crate) use { }, camino::Utf8Path, clap::ValueEnum, - derivative::Derivative, + derive_where::derive_where, edit_distance::edit_distance, lexiclean::Lexiclean, libc::EXIT_FAILURE, diff --git a/src/thunk.rs b/src/thunk.rs index 82668998..8c7ddfa8 100644 --- a/src/thunk.rs +++ b/src/thunk.rs @@ -1,46 +1,46 @@ use super::*; -#[derive(Derivative)] -#[derivative(Debug, Clone, PartialEq = "feature_allow_slow_enum")] +#[derive_where(Debug, PartialEq)] +#[derive(Clone)] pub(crate) enum Thunk<'src> { Nullary { name: Name<'src>, - #[derivative(Debug = "ignore", PartialEq = "ignore")] + #[derive_where(skip(Debug, EqHashOrd))] function: fn(function::Context) -> FunctionResult, }, Unary { name: Name<'src>, - #[derivative(Debug = "ignore", PartialEq = "ignore")] + #[derive_where(skip(Debug, EqHashOrd))] function: fn(function::Context, &str) -> FunctionResult, arg: Box>, }, UnaryOpt { name: Name<'src>, - #[derivative(Debug = "ignore", PartialEq = "ignore")] + #[derive_where(skip(Debug, EqHashOrd))] function: fn(function::Context, &str, Option<&str>) -> FunctionResult, args: (Box>, Box>>), }, UnaryPlus { name: Name<'src>, - #[derivative(Debug = "ignore", PartialEq = "ignore")] + #[derive_where(skip(Debug, EqHashOrd))] function: fn(function::Context, &str, &[String]) -> FunctionResult, args: (Box>, Vec>), }, Binary { name: Name<'src>, - #[derivative(Debug = "ignore", PartialEq = "ignore")] + #[derive_where(skip(Debug, EqHashOrd))] function: fn(function::Context, &str, &str) -> FunctionResult, args: [Box>; 2], }, BinaryPlus { name: Name<'src>, - #[derivative(Debug = "ignore", PartialEq = "ignore")] + #[derive_where(skip(Debug, EqHashOrd))] function: fn(function::Context, &str, &str, &[String]) -> FunctionResult, args: ([Box>; 2], Vec>), }, Ternary { name: Name<'src>, - #[derivative(Debug = "ignore", PartialEq = "ignore")] + #[derive_where(skip(Debug, EqHashOrd))] function: fn(function::Context, &str, &str, &str) -> FunctionResult, args: [Box>; 3], },