From aebee7c84176ea224d858fee9fd7e430c6d6cc54 Mon Sep 17 00:00:00 2001 From: Zhang Yanpo Date: Sun, 16 Mar 2025 12:38:15 +0800 Subject: [PATCH 1/2] feat: impl MatchSeqExt for &T and Option --- src/match_seq/match_seq_ext_impls.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/match_seq/match_seq_ext_impls.rs b/src/match_seq/match_seq_ext_impls.rs index ac597ae..4a6dd6f 100644 --- a/src/match_seq/match_seq_ext_impls.rs +++ b/src/match_seq/match_seq_ext_impls.rs @@ -37,15 +37,21 @@ impl MatchSeqExt> for MatchSeq { } } -impl MatchSeqExt>> for MatchSeq { - fn match_seq(&self, sv: &Option<&SeqV>) -> Result<(), ConflictSeq> { - let seq = sv.map_or(0, |sv| sv.seq); - self.match_seq(&seq) +impl MatchSeqExt<&T> for MatchSeq +where MatchSeq: MatchSeqExt +{ + fn match_seq(&self, sv: &&T) -> Result<(), ConflictSeq> { + self.match_seq(*sv) } } -impl MatchSeqExt>> for MatchSeq { - fn match_seq(&self, sv: &Option>) -> Result<(), ConflictSeq> { - self.match_seq(&sv.as_ref()) +impl MatchSeqExt> for MatchSeq +where MatchSeq: MatchSeqExt +{ + fn match_seq(&self, sv: &Option) -> Result<(), ConflictSeq> { + match sv { + Some(sv) => self.match_seq(sv), + None => MatchSeqExt::::match_seq(self, &0u64), + } } } From e4de1786b63d2c401413413ac8069f305c849c06 Mon Sep 17 00:00:00 2001 From: Zhang Yanpo Date: Sun, 16 Mar 2025 12:38:33 +0800 Subject: [PATCH 2/2] BumpVer: 0.2.3 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 72a0ad0..5cc582d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "map-api" description = "Raft state machine" -version = "0.2.2" +version = "0.2.3" authors = ["Databend Authors "] license = "Apache-2.0" edition = "2021"