@@ -14,9 +14,9 @@ use crate::{
14
14
#[ non_exhaustive]
15
15
pub struct SummaryBulkWriteResult {
16
16
pub inserted_count : i64 ,
17
- pub upserted_count : i64 ,
18
17
pub matched_count : i64 ,
19
18
pub modified_count : i64 ,
19
+ pub upserted_count : i64 ,
20
20
pub deleted_count : i64 ,
21
21
}
22
22
@@ -27,9 +27,9 @@ pub struct SummaryBulkWriteResult {
27
27
#[ non_exhaustive]
28
28
pub struct VerboseBulkWriteResult {
29
29
pub inserted_count : i64 ,
30
- pub upserted_count : i64 ,
31
30
pub matched_count : i64 ,
32
31
pub modified_count : i64 ,
32
+ pub upserted_count : i64 ,
33
33
pub deleted_count : i64 ,
34
34
#[ cfg_attr(
35
35
test,
@@ -59,8 +59,6 @@ mod result_trait {
59
59
60
60
fn merge ( & mut self , other : Self ) ;
61
61
62
- fn empty_partial_result ( ) -> PartialBulkWriteResult ;
63
-
64
62
fn into_partial_result ( self ) -> PartialBulkWriteResult ;
65
63
66
64
fn populate_summary_info (
@@ -90,23 +88,19 @@ impl BulkWriteResult for SummaryBulkWriteResult {
90
88
fn merge ( & mut self , other : Self ) {
91
89
let SummaryBulkWriteResult {
92
90
inserted_count : other_inserted_count,
93
- upserted_count : other_upserted_count,
94
91
matched_count : other_matched_count,
95
92
modified_count : other_modified_count,
93
+ upserted_count : other_upserted_count,
96
94
deleted_count : other_deleted_count,
97
95
} = other;
98
96
99
97
self . inserted_count += other_inserted_count;
100
- self . upserted_count += other_upserted_count;
101
98
self . matched_count += other_matched_count;
102
99
self . modified_count += other_modified_count;
100
+ self . upserted_count += other_upserted_count;
103
101
self . deleted_count += other_deleted_count;
104
102
}
105
103
106
- fn empty_partial_result ( ) -> PartialBulkWriteResult {
107
- PartialBulkWriteResult :: Summary ( Default :: default ( ) )
108
- }
109
-
110
104
fn into_partial_result ( self ) -> PartialBulkWriteResult {
111
105
PartialBulkWriteResult :: Summary ( self )
112
106
}
@@ -154,10 +148,6 @@ impl BulkWriteResult for VerboseBulkWriteResult {
154
148
self . delete_results . extend ( other_delete_results) ;
155
149
}
156
150
157
- fn empty_partial_result ( ) -> PartialBulkWriteResult {
158
- PartialBulkWriteResult :: Verbose ( Default :: default ( ) )
159
- }
160
-
161
151
fn into_partial_result ( self ) -> PartialBulkWriteResult {
162
152
PartialBulkWriteResult :: Verbose ( self )
163
153
}
0 commit comments