Commit cdd0ba8
authored
Rollup merge of rust-lang#102569 - eduardosm:from_str-example, r=joshtriplett
Improve `FromStr` example
The `from_str` implementation from the example had an `unwrap` that would make it panic on invalid input strings. Instead of panicking, it nows returns an error to better reflect the intented behavior of the `FromStr` trait.1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | 510 | | |
512 | 511 | | |
513 | 512 | | |
514 | 513 | | |
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
518 | 520 | | |
519 | | - | |
| 521 | + | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
523 | 525 | | |
524 | 526 | | |
525 | 527 | | |
526 | | - | |
| 528 | + | |
527 | 529 | | |
528 | | - | |
529 | | - | |
| 530 | + | |
| 531 | + | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
| |||
538 | 540 | | |
539 | 541 | | |
540 | 542 | | |
| 543 | + | |
| 544 | + | |
541 | 545 | | |
542 | 546 | | |
543 | 547 | | |
| |||
0 commit comments