Commit 726b9b7
authored
Rollup merge of rust-lang#127287 - aDotInTheVoid:jsondocck-index, r=GuillaumeGomez
jsondocck: Use correct index for error message.
If you misused a count command like ``@count` $some.selector '"T'"`, you would panic with OOB:
```
thread 'main' panicked at src/tools/jsondocck/src/main.rs:76:92:
index out of bounds: the len is 2 but the index is 2
```
This is because 57c85bd removed the file param, but didn't update the error case. We now error with:
```
Invalid command: Second argument to `@count` must be a valid usize (got `"T"`) on line 20
```
As some point I want to rewrite this code to avoid indexing in general, but this is a nice small fix.
r? `@GuillaumeGomez`1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
74 | | - | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
0 commit comments