@@ -33,30 +33,36 @@ impl<T> TransactionContext<T> {
3333 }
3434}
3535
36- impl < T > Ord for TransactionContext < T > {
36+ impl < T : Eq > Ord for TransactionContext < T > {
3737 fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
3838 self . metadata
3939 . start_version
4040 . cmp ( & other. metadata . start_version )
41+ . then_with ( || self . metadata . end_version . cmp ( & other. metadata . end_version ) )
4142 }
4243}
4344
44- impl < T > PartialOrd for TransactionContext < T > {
45+ impl < T : PartialEq > PartialOrd for TransactionContext < T > {
4546 fn partial_cmp ( & self , other : & Self ) -> Option < std:: cmp:: Ordering > {
46- Some ( self . cmp ( other) )
47+ Some (
48+ self . metadata
49+ . start_version
50+ . cmp ( & other. metadata . start_version )
51+ . then_with ( || self . metadata . end_version . cmp ( & other. metadata . end_version ) ) ,
52+ )
4753 }
4854}
4955
50- impl < T > Eq for TransactionContext < T > { }
56+ impl < T : Eq > Eq for TransactionContext < T > { }
5157
52- impl < T > PartialEq for TransactionContext < T > {
58+ impl < T : PartialEq > PartialEq for TransactionContext < T > {
5359 fn eq ( & self , other : & Self ) -> bool {
54- self . metadata . start_version == other. metadata . start_version
60+ self . data == other. data && self . metadata == other . metadata
5561 }
5662}
5763
5864// Metadata about a batch of transactions
59- #[ derive( Clone , Default ) ]
65+ #[ derive( Clone , Default , PartialEq ) ]
6066pub struct TransactionMetadata {
6167 pub start_version : u64 ,
6268 pub end_version : u64 ,
0 commit comments