Commit 91f6883
committed
Remove unnecessary
`cargo metadata` already validates the version, checking that it's
a string satisfying one of a small number of recognized formats. So
the only validation `jq` needs to do is to make sure it is really
only appending `.0` to the end if it is of the form `X.Y` for
nonempty numeric `X` and `Y` (with no other characters anywhere).
This shortens the `jq` query considerably, removing the unnecessary
validation and also using regular expression replacement to replace
the empty string that follows the a *full* `X.Y` line with `.0`.jq validation of rust-version
1 parent efeb6e6 commit 91f6883
1 file changed
+1
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 245 | + | |
255 | 246 | | |
256 | 247 | | |
257 | 248 | | |
| |||
0 commit comments