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
the default value of Edition field is 2015, it can't tell the difference edition set with 2015 and edition not set. #250
Comments
I don't think this crate
If possible, please share why you need to know it is not set, and maybe we can come up with a better alternative. |
@weihanglo thanks for you reply. The background is that i make a custom lint to check whethe the rust edition is set or not. the detail is:
without the |
My personal stance would be like: the lint should either be implemented in Cargo or reuse the TOML manifest parser in Cargo. Either way, I agree See this zulip discussion for more: https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Cargo.20Lints/near/389439777 |
How to know that rust edition not set in Cargo.toml? I want to know whethe edition is set or not in the Cargo.toml.
In this situation, I found that the Edition offered by the cargo_metadata crate set the default value 2015, so I had no idea to know rust edition is not set in cargo.toml, because it will be set the default value 2015 when serde_json crate parse the toml file.
the relative code is below:
https://github.com/oli-obk/cargo_metadata/blob/main/src/lib.rs
Forgive my poor english expression since i am not native english speaker. My need is to know whethe edition is set or not in the Cargo.toml. Maybe the cargo_metadata can offer a way to tell the edition not set in the Cargo.toml, like this
The text was updated successfully, but these errors were encountered: