Use rust-s3 without tokio?

Viewed 117

I want to use the rust-s3 crate in the simplest & lightest possible way (w/o async). By default this crate uses tokio. So I followed what's written in rust-s3's README:

With default-features = false

  • sync - no async runtime, attohttpc is used for HTTP requests

So in my Cargo.toml I added this:

[dependencies]
rust-s3 = { version = "0.28.1", default-features = false, features = ["sync"] }

When I read "no async runtime", I don't expect to see tokio added as a dependency. However, tokio is still being added. And looking at the crate's Cargo.toml, I see it has a (non-optional) dependency on tokio-stream, which, in turn, depends on tokio. This is from cargo tree's output in my project:

├── tokio-stream v0.1.8
│   ├── futures-core v0.3.19
│   ├── pin-project-lite v0.2.8
│   └── tokio v1.15.0
│       └── pin-project-lite v0.2.8

So it seems to me it's actually not possible to avoid adding tokio as a dependency, the way this crate is written. Am I right or am I missing something here?

1 Answers

I kinda reached the conclusion tokio in its default mode has almost nothing (no runtime, etc.), so maybe that's why, even though it is included as a dependency, it shouldn't add much of a baggage in itself.

Related