Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File and Named examples are doubled #12

Open
FrankReh opened this issue Oct 13, 2024 · 0 comments
Open

File and Named examples are doubled #12

FrankReh opened this issue Oct 13, 2024 · 0 comments

Comments

@FrankReh
Copy link

With my own Cargo.toml where I have no examples explicitly given but where I do have two standalone files in the examples directory. I found version 0.5.0 runs the examples twice each.

Putting in some dbg! lines into the cargo-examples src and rerunning, the loop that runs through the manifest examples is adding entries that are already in the examples vec, but under a different form.

The first loop adds them as File() variants, but the second loop adds them again as Named() variants.

Here's what the examples vec looked like before they were run, one after the other:

[src/main.rs:168:5] &examples = [
    File(
        "./examples/single.rs",
    ),
    File(
        "./examples/three.rs",
    ),
    Named(
        "single",
    ),
    Named(
        "three",
    ),
]

Unrelated but I found I could update the cargo_toml dependency to 0.20, from 0.14, but I did have to change the path being provided from "Cargo.toml" to "./Cargo.toml". Didn't make any difference to the doubling of the examples though so not relevant here.

And to help avoid any confusion, here is the Cargo.toml:

 $ cat Cargo.toml
[package]
name = "abc"
version = "0.1.0"
edition = "2021"

[dependencies]
libc = "0.2.159"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant