bytecodealliance / bytecodealliance/cargo-component

`cargo component build` does not add `mod bindings` to `main.rs`

Open
#361 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
593
Forks
68
PR merge metrics
No merged PRs in 30d

Description

When I walked through the tutorial in https://component-model.bytecodealliance.org/language-support/rust.html#importing-an-interface-into-a-command-component with my own adder example, after Step 3 adding `package.metadata.component.target.dependencies` and running `cargo build component`, I found `bindings.rs` was generated under `src` folder, but `mod bindings` was not added to `main.rs`.

`main.rs` was initially created by `cargo component new my-command-component` with the content
```rust
fn main() {
println!("Hello World");
}
```

I think after generating `bindings.rs`, `cargo-component` should automatically attach it to `main.rs`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.