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

[bug] missing field version - should not report #101

Closed
1oglop1 opened this issue Feb 8, 2024 · 6 comments
Closed

[bug] missing field version - should not report #101

1oglop1 opened this issue Feb 8, 2024 · 6 comments

Comments

@1oglop1
Copy link

1oglop1 commented Feb 8, 2024

Hi I have a Cargo.toml file without version and machete is failing
with

  |
1 | [package]
  | ^^^^^^^^^
missing field `version`

However, the version field is optional and has been for some time already.
https://doc.rust-lang.org/cargo/reference/manifest.html#the-version-field

@bnjbvr
Copy link
Owner

bnjbvr commented Feb 10, 2024

Thanks for opening an issue, it might be one of the dependencies used for parsing that's responsible of that. Would you be interested in solving this with a pull request?

@1oglop1
Copy link
Author

1oglop1 commented Feb 11, 2024

I am not really a Rust magician, but it looks like you have pointed in the right direction:

https://gitlab.com/lib.rs/cargo_toml/-/blob/main/src/cargo_toml.rs?ref_type=heads#L1540-1545

I will try to open an issue there and see if anything comes out of it.

ref: https://gitlab.com/lib.rs/cargo_toml/-/issues/31

@kornelski
Copy link

cargo_toml supports optional version, but you're using outdated cargo_toml.

bnjbvr added a commit that referenced this issue Feb 12, 2024
@bnjbvr bnjbvr closed this as completed in b51f860 Feb 12, 2024
@dspicher
Copy link

@bnjbvr would you consider making a release to give access this fix? Would be great!

@bnjbvr
Copy link
Owner

bnjbvr commented Feb 21, 2024

@dspicher yes, doing this now in #108

@dspicher
Copy link

Thanks!

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

4 participants