rust-script icon indicating copy to clipboard operation
rust-script copied to clipboard

Does the short `cargo-deps` line work for crate features?

Open 0atman opened this issue 6 months ago • 0 comments

I'd like to replace the long, full tokio manifest header:

//! ```cargo
//! [dependencies]
//! tokio = { version = "1", features = ["full"] }
//! ```
async fn my_async_fn_scope(url: &String) {
  todo!()
}

With something like:

// cargo-deps: tokio = { version = "1", features = ["full"] }
async fn my_async_fn_scope(url: &String) {
  todo!()
}

But it looks like the extra syntax might not be supported?

error: could not parse embedded manifest: TOML parse error at line 2, column 24
  |
2 | tokio = { version = "1"
  |                        ^
invalid inline table
expected `}`

Thanks!

0atman avatar Jun 18 '25 06:06 0atman