DEV Community

Discussion on: Build a REST API with Rust and MongoDB - Actix web Version

Collapse
 
malomz profile image
Demola Malomo

Hi @kmahar ,

Thanks for pointing this out πŸ™πŸ™.

I have updated accordinglyπŸ‘

Collapse
 
kmahar profile image
kaitlin

Awesome! One more thing to note is that since Actix uses the tokio runtime, I'd suggest using the driver with tokio as well, rather than async-std, so that you do not need to have two separate runtimes going that cannot coordinate with one another.

By default the mongodb crate uses tokio, so to do this, you can just remove these lines from your Cargo.toml:

default-features = false
features = ["async-std-runtime"] 
Enter fullscreen mode Exit fullscreen mode

There's some documentation on all of the drivers' feature flags available here.