oli-obk / cargo_metadata

MIT License
171 stars 94 forks source link

Why stringly typed data? #151

Closed qrilka closed 3 years ago

qrilka commented 3 years ago

It's more of a question and probably I don't see enough details but why Target.kind has a type Vec<String> and doesn't use a proper enum for kinds? Could a kind contain an arbitrary string?

oli-obk commented 3 years ago

sometimes because I didn't put the effort in to actually figure out what variants it has, sometimes because for backwards compat, it needs to accept any string. Basically we need to check what the actual rules in cargo are and then we can make the implementation more strict.

oli-obk commented 3 years ago

I'm going to do a major version bump again soon, so if you have any changes like this that you want to get in, now is a good time. I'm closing this issue now since I'm not going to track this explicitly.

qrilka commented 3 years ago

@oli-obk I once again touched a some lines in cargo-geiger related to this package. Do you have any upcoming changes which are not in master which you plan for this upcoming major version bump? I was just wandering if that could help cargo-geiger in some way...

oli-obk commented 3 years ago

I'm still fixing something on master, but in general, that is the plan for the next release

msrd0 commented 2 years ago

Is this still something you'd like to see changed? It looks like cargo's targets have one single kind which is an enum: https://docs.rs/cargo/0.64.0/src/cargo/core/manifest.rs.html#205