Skip to content

Commit 90ea63d

Browse files
authored
DOCSP-43247: Update cargo.toml instructions (#129)
1 parent a3cb374 commit 90ea63d

File tree

2 files changed

+13
-42
lines changed

2 files changed

+13
-42
lines changed

source/fundamentals/runtimes.txt

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@ Configure the Asynchronous Runtime
4444
----------------------------------
4545

4646
The driver uses the ``tokio`` runtime by default, so you can use this runtime without specifying any
47-
feature flags in your project's ``Cargo.toml`` file.
48-
49-
You can explicitly choose the ``tokio`` runtime by adding the ``"tokio-runtime"`` feature flag to
50-
the ``mongodb`` dependency. For more information on installing the driver and adding feature flags,
51-
including an example that specifies the ``"tokio-runtime"`` feature flag, see the
52-
:ref:`rust-quick-start-download-and-install` step of the Quick Start.
47+
feature flags in your project's ``Cargo.toml`` file. For more information on installing the driver
48+
and configuring your ``Cargo.toml`` file, see the :ref:`rust-quick-start-download-and-install` step
49+
of the Quick Start.
5350

5451
.. important::
5552

@@ -80,32 +77,14 @@ Configure the Synchronous API
8077
-----------------------------
8178

8279
The driver also provides a blocking, synchronous API.
83-
To use the synchronous API, add the either the ``"sync"`` or ``"tokio-sync"`` feature flag
84-
to the ``mongodb`` dependency.
85-
86-
Select from the following tabs to see how to add feature flags for each corresponding crate:
87-
88-
.. tabs::
89-
90-
.. tab:: sync
91-
:tabid: synchronous-api
92-
93-
.. code-block:: toml
80+
To use the ``tokio`` synchronous API, add the ``"sync"`` feature flag to
81+
the ``mongodb`` dependency, as shown in the following example:
9482

95-
[dependencies.mongodb]
96-
version = "{+version+}"
97-
default-features = false
98-
features = ["sync"]
99-
100-
.. tab:: tokio-sync
101-
:tabid: synchronous-api-tokio
102-
103-
.. code-block:: toml
83+
.. code-block:: toml
10484

105-
[dependencies.mongodb]
106-
version = "{+version+}"
107-
default-features = false
108-
features = ["tokio-sync"]
85+
[dependencies.mongodb]
86+
version = "{+version+}"
87+
features = ["sync"]
10988

11089
Synchronous Code Example
11190
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -124,8 +103,8 @@ Use Both Asynchronous and Synchronous APIs
124103
------------------------------------------
125104

126105
You can use both asynchronous and synchronous APIs in the same application.
127-
For example, to enable both ``tokio`` runtimes, you can add the ``tokio`` dependency to your dependencies list, and add the
128-
``"tokio-sync"`` flag to the ``mongodb`` dependency:
106+
For example, to enable both ``tokio`` runtimes, you can add the ``tokio`` dependency
107+
to your dependencies list and add the ``"sync"`` flag to the ``mongodb`` dependency:
129108

130109
.. code-block:: toml
131110

@@ -135,7 +114,7 @@ For example, to enable both ``tokio`` runtimes, you can add the ``tokio`` depend
135114

136115
[dependencies.mongodb]
137116
version = "{+version+}"
138-
features = ["tokio-sync"]
117+
features = ["sync"]
139118

140119
.. _rust-addtl-info-runtimes:
141120

source/quick-start/download-and-install.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ Download and Install
7676

7777
[dependencies.mongodb]
7878
version = "{+version+}"
79-
features = ["tokio-runtime"]
80-
81-
.. tip::
82-
83-
The ``tokio`` asynchronous runtime is the driver's default runtime crate
84-
and does not require a feature flag. The preceding code example includes
85-
the ``"tokio-runtime"`` feature flag to specify the ``tokio`` runtime, but
86-
this flag is optional.
8779

8880
.. tab:: Synchronous API
8981
:tabid: synchronous-api
@@ -95,7 +87,7 @@ Download and Install
9587

9688
[dependencies.mongodb]
9789
version = "{+version+}"
98-
features = ["tokio-sync"]
90+
features = ["sync"]
9991

10092
To learn more about asynchronous and synchronous runtimes, see the :ref:`rust-runtimes`
10193
guide.

0 commit comments

Comments
 (0)