Skip to content

Commit 8345a13

Browse files
authored
DOCSP-44854: fix stable api options code (#136)
1 parent 1704aa5 commit 8345a13

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

source/fundamentals/stable-api.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ and connects to a server.
7070
:dedent:
7171
:start-after: start-stable-api
7272
:end-before: end-stable-api
73+
:emphasize-lines: 3-4
7374

7475
.. _rust-stable-api-options:
7576

source/includes/fundamentals/code-snippets/stable-api-behavior.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
use mongodb::{
2-
bson::doc,
3-
options::{ClientOptions, ServerApi, ServerApiVersion},
4-
sync::Client,
5-
};
1+
use mongodb::{ bson::doc, options::{ ClientOptions, ServerApi, ServerApiVersion }, sync::Client };
62

73
fn main() -> mongodb::error::Result<()> {
84
let uri = "<connection string>";
95
// start-stable-api-behavior
10-
let mut client_options = ClientOptions::parse(uri)?;
6+
let mut client_options = ClientOptions::parse(uri).await?;
117

128
let server_api = ServerApi::builder()
139
.version(ServerApiVersion::V1)

source/includes/fundamentals/code-snippets/stable-api.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
use mongodb::{
2-
bson::doc,
3-
options::{ClientOptions, ServerApi, ServerApiVersion},
4-
sync::Client,
5-
};
1+
use mongodb::{ bson::doc, options::{ ClientOptions, ServerApi, ServerApiVersion }, sync::Client };
62

73
fn main() -> mongodb::error::Result<()> {
84
let uri = "<connection string>";
9-
let mut client_options = ClientOptions::parse(uri)?;
10-
115
// start-stable-api
6+
let mut client_options = ClientOptions::parse(uri).await?;
7+
128
let server_api = ServerApi::builder().version(ServerApiVersion::V1).build();
139
client_options.server_api = Some(server_api);
1410

0 commit comments

Comments
 (0)