Skip to content

Commit bcc912c

Browse files
committed
Adjust install of ashpd to avoid tokio
Since version 0.10 `ashpd` has shipped with the `tokio` feature enabled by default. This slightly undermines this section of the book where the author is discussing non-tokio ways to run async code. This commit adjusts the command for adding `ashpd` to exclude `tokio` and use the previously expected `async-std` feature instead. Without this change, the example code compiles but panics with a `there is no reactor running` message. With this change, the example code runs successfully.
1 parent 97e1109 commit bcc912c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/src/main_event_loop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ Filename: <a class=file-link href="https://github.com/gtk-rs/gtk4-rs/blob/main/b
213213
Asynchronous functions from the `glib` ecosystem can always be spawned on the `glib` main loop.
214214
Typically, crates depending on `async-std` or `smol` work as well.
215215
Let us take `ashpd` for example which allows sandboxed applications to interact with the desktop.
216-
Per default it depends on `async-std`.
216+
It can be configured to depend on `async-std`.
217217
We can add it to our dependencies by running the following command.
218218

219219
```
220-
cargo add ashpd --features gtk4
220+
cargo add ashpd --no-default-features --features "gtk4 async-std"
221221
```
222222

223223
You need to use a Linux desktop environment in order to run the following example locally.

0 commit comments

Comments
 (0)