From d0da97577f043fbf59e345ab4fe3a6b8936b06c3 Mon Sep 17 00:00:00 2001 From: Chielo Newctle Date: Thu, 29 Feb 2024 14:46:40 +0800 Subject: [PATCH] chore(deps): update dependencies --- Cargo.toml | 10 +++------- src/sam.rs | 13 +++++-------- src/utils.rs | 3 +++ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f33414c..9252ce9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,6 @@ name = "general_sam" crate-type = ["cdylib"] [dependencies] -general-sam = { version = "0.6.1", features = ["all"] } -pyo3 = { version = "0.20.0", features = [ - "extension-module", - "abi3-py38", - "generate-import-lib", -] } -either = "1.9.0" +either = "1.10.0" +general-sam = { version = "0.7.0", features = ["all"] } +pyo3 = { version = "0.20.3", features = ["extension-module", "generate-import-lib", "abi3-py38"] } diff --git a/src/sam.rs b/src/sam.rs index 7f1363e..d2c39d6 100644 --- a/src/sam.rs +++ b/src/sam.rs @@ -243,10 +243,10 @@ impl GeneralSAM { GeneralSAMState(for_both_with_side!( self.0.as_ref(), side, - x => side(RustBoxBisectGeneralSAMState { - sam: x.clone(), - node_id: SAM_ROOT_NODE_ID, - }) + x => side(RustBoxBisectGeneralSAMState::new( + x.clone(), + SAM_ROOT_NODE_ID, + )), )) } @@ -254,10 +254,7 @@ impl GeneralSAM { GeneralSAMState(for_both_with_side!( self.0.as_ref(), side, - x => side(RustBoxBisectGeneralSAMState { - sam: x.clone(), - node_id, - }) + x => side(RustBoxBisectGeneralSAMState::new(x.clone(), node_id)), )) } diff --git a/src/utils.rs b/src/utils.rs index cca5d79..471f2d6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -53,6 +53,9 @@ macro_rules! for_both_with_side { } } }; + ($value:expr, $side:ident, $pattern:pat => $result:expr,) => { + for_both_with_side!($value, $side, $pattern => $result) + } } pub use for_both_with_side;