Commit f6b678e
committed
review: make
this changes all the `index_files` fields to be `Option<Vec<String>>`
instead of only a vec. this lets API users simply pass a None to
get the default behaviour.
documentation at the higher level interfaces (e.g., the CLI help)
is changed to remove reference to `.` as the default behaviour.
now, the default behaviour is defined in terms of its observable
behaviour without reference to this implementation detail.
that said, the index file resolution still has this special case
that `.` is allowed in the `index_files` list. this allows the
(possibly esoteric) case where a user passes `--index-files index.html,.`
to use an index file if it exists but still accept the link regardless.
the None case for index_files is still implemented by mapping
to an index file list of `["."]`, but this is now only an
implementation detail of `apply_index_files`.
finally, using an Option is nicer than special-casing the empty
`Vec<String>` case, because the empty vec case /should/ reject
all directory links. this follows logically because the fewer
items in the index file list, the fewer directory links are valid.index_files an Option for clearer default behavior1 parent 8d25acd commit f6b678e
File tree
4 files changed
+64
-59
lines changed- lychee-bin/src
- lychee-lib/src
- checker
4 files changed
+64
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
468 | 467 | | |
469 | | - | |
470 | | - | |
471 | | - | |
| 468 | + | |
| 469 | + | |
472 | 470 | | |
473 | | - | |
474 | | - | |
475 | | - | |
| 471 | + | |
| 472 | + | |
476 | 473 | | |
477 | 474 | | |
478 | 475 | | |
479 | 476 | | |
480 | 477 | | |
481 | | - | |
482 | | - | |
483 | 478 | | |
484 | 479 | | |
485 | 480 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
567 | 566 | | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
572 | 570 | | |
573 | | - | |
574 | | - | |
575 | | - | |
| 571 | + | |
| 572 | + | |
576 | 573 | | |
577 | | - | |
578 | | - | |
579 | | - | |
| 574 | + | |
| 575 | + | |
580 | 576 | | |
581 | 577 | | |
582 | 578 | | |
583 | 579 | | |
584 | 580 | | |
585 | | - | |
| 581 | + | |
586 | 582 | | |
587 | 583 | | |
588 | 584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | | - | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
47 | | - | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
181 | 190 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 191 | + | |
| 192 | + | |
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
190 | | - | |
| 197 | + | |
191 | 198 | | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
196 | 203 | | |
197 | | - | |
198 | | - | |
| 204 | + | |
| 205 | + | |
199 | 206 | | |
200 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
| |||
304 | 318 | | |
305 | 319 | | |
306 | 320 | | |
307 | | - | |
308 | | - | |
309 | | - | |
| 321 | + | |
| 322 | + | |
310 | 323 | | |
311 | 324 | | |
312 | 325 | | |
| |||
338 | 351 | | |
339 | 352 | | |
340 | 353 | | |
341 | | - | |
| 354 | + | |
342 | 355 | | |
343 | 356 | | |
344 | 357 | | |
| |||
377 | 390 | | |
378 | 391 | | |
379 | 392 | | |
380 | | - | |
| 393 | + | |
381 | 394 | | |
382 | 395 | | |
383 | 396 | | |
| |||
411 | 424 | | |
412 | 425 | | |
413 | 426 | | |
414 | | - | |
| 427 | + | |
415 | 428 | | |
416 | 429 | | |
417 | 430 | | |
| |||
435 | 448 | | |
436 | 449 | | |
437 | 450 | | |
438 | | - | |
| 451 | + | |
439 | 452 | | |
440 | 453 | | |
441 | 454 | | |
| |||
456 | 469 | | |
457 | 470 | | |
458 | 471 | | |
459 | | - | |
| 472 | + | |
460 | 473 | | |
461 | 474 | | |
462 | 475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
0 commit comments