cargo-component icon indicating copy to clipboard operation
cargo-component copied to clipboard

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

Open ifsheldon opened this issue 1 year ago • 0 comments

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

fn main() {
    println!("Hello World");
}

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

ifsheldon avatar Dec 08 '24 08:12 ifsheldon