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" 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), + } } }