@@ -115,13 +115,11 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
115
115
let id = format ! ( "unique_id{}" , 3 ) ;
116
116
let partition_key = & id;
117
117
118
- let response = client
118
+ let response: GetDocumentResponse < MySampleStruct > = client
119
119
. clone ( )
120
120
. into_document_client ( id. clone ( ) , partition_key) ?
121
- . get_document :: < MySampleStruct > (
122
- Context :: new ( ) ,
123
- GetDocumentOptions :: new ( ) . consistency_level ( session_token) ,
124
- )
121
+ . get_document ( )
122
+ . into_future ( )
125
123
. await ?;
126
124
127
125
assert ! ( matches!( response, GetDocumentResponse :: Found ( _) ) ) ;
@@ -137,13 +135,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
137
135
let replace_document_response = client
138
136
. clone ( )
139
137
. into_document_client ( id. clone ( ) , & id) ?
140
- . replace_document (
141
- Context :: new ( ) ,
142
- & doc. document ,
143
- ReplaceDocumentOptions :: new ( )
144
- . consistency_level ( ConsistencyLevel :: from ( & response) )
145
- . if_match_condition ( IfMatchCondition :: Match ( doc. etag ) ) , // use optimistic concurrency check
146
- )
138
+ . replace_document ( doc. document )
139
+ . consistency_level ( ConsistencyLevel :: from ( & response) )
140
+ . if_match_condition ( IfMatchCondition :: Match ( doc. etag ) ) // use optimistic concurrency check
141
+ . into_future ( )
147
142
. await ?;
148
143
149
144
println ! (
@@ -155,14 +150,12 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
155
150
// has_been_found == false
156
151
println ! ( "\n \n Looking for non-existing item" ) ;
157
152
let id = format ! ( "unique_id{}" , 100 ) ;
158
-
159
- let response = client
153
+ let response: GetDocumentResponse < MySampleStruct > = client
160
154
. clone ( )
161
155
. into_document_client ( id. clone ( ) , & id) ?
162
- . get_document :: < MySampleStruct > (
163
- Context :: new ( ) ,
164
- GetDocumentOptions :: new ( ) . consistency_level ( & response) ,
165
- )
156
+ . get_document ( )
157
+ . consistency_level ( & response)
158
+ . into_future ( )
166
159
. await ?;
167
160
168
161
assert ! ( matches!( response, GetDocumentResponse :: NotFound ( _) ) ) ;
0 commit comments