@@ -18,12 +18,12 @@ async fn main() -> mongodb::error::Result<()> {
18
18
let my_coll: Collection < Document > = client. database ( "db" ) . collection ( "books" ) ;
19
19
let doc = doc ! { "title" : "Atonement" , "author" : "Ian McEwan" } ;
20
20
21
- let insert_one_result: InsertOneResult = my_coll. insert_one ( doc, None ) . await ?;
21
+ let insert_one_result = my_coll. insert_one ( doc, None ) . await ?;
22
22
println ! ( "Inserted document with _id: {}" , insert_one_result. inserted_id) ;
23
23
// end-insert-one
24
24
25
25
// begin-one-options
26
- let _opts: InsertOneOptions = InsertOneOptions :: builder ( )
26
+ let _opts = InsertOneOptions :: builder ( )
27
27
. bypass_document_validation ( true )
28
28
. build ( ) ;
29
29
// end-one-options
@@ -36,15 +36,15 @@ async fn main() -> mongodb::error::Result<()> {
36
36
doc! { "title" : "Pride and Prejudice" , "author" : "Jane Austen" }
37
37
] ;
38
38
39
- let insert_many_result: InsertManyResult = my_coll. insert_many ( docs, None ) . await ?;
39
+ let insert_many_result = my_coll. insert_many ( docs, None ) . await ?;
40
40
println ! ( "Inserted documents with _ids:" ) ;
41
41
for ( _key, value) in & insert_many_result. inserted_ids {
42
42
println ! ( "{}" , value) ;
43
43
}
44
44
// end-insert-many
45
45
46
46
// begin-many-options
47
- let _opts: InsertManyOptions = InsertManyOptions :: builder ( )
47
+ let _opts = InsertManyOptions :: builder ( )
48
48
. comment ( bson ! ( "hello world" ) )
49
49
. build ( ) ;
50
50
// end-many-options
@@ -57,7 +57,7 @@ async fn main() -> mongodb::error::Result<()> {
57
57
doc! { "_id" : 3 , "title" : "Goodnight Moon" }
58
58
] ;
59
59
60
- let opts: InsertManyOptions = InsertManyOptions :: builder ( ) . ordered ( false ) . build ( ) ;
60
+ let opts = InsertManyOptions :: builder ( ) . ordered ( false ) . build ( ) ;
61
61
my_coll. insert_many ( docs, opts) . await ?;
62
62
// end-unordered
63
63
0 commit comments