floem icon indicating copy to clipboard operation
floem copied to clipboard

Examples cannot be run with `cargo run --example`

Open PoignardAzur opened this issue 1 year ago • 3 comments

Because each example is its own sub-project, running cargo --example example-name doesn't work.

This maybe makes sense for examples that include assets or special dependencies, but from a quick skim most examples only include a single Rust files and could be normal files in the example/ folder. This would make them more convenient to test.

PoignardAzur avatar Jan 09 '24 12:01 PoignardAzur

You can run examples with cargo run -p example-name

panekj avatar Jan 09 '24 12:01 panekj

Oh, I didn't know that. :smiley:

I think being able to run examples using the usual flow would be better. But it's helpful to know there's a workaround.

PoignardAzur avatar Jan 09 '24 12:01 PoignardAzur

It's not really a workaround, both cargo run -p and cargo --example are common patterns for doing examples, it really depends on the project preference which is used

panekj avatar Jan 09 '24 13:01 panekj