Commit 8560318
authored
Loosen type restriction on
`Ryu.writeshortest` is documented to have a method that "allows passing
in a byte buffer", just like `Ryu.writefixed` and `Ryu.writeexp`, but
unlike those functions `writeshortest` is type constrained to
`::Vector{UInt8}`. This PR loosens that to `::AbstractVector{UInt8}`, to
allow the "byte buffer" to e.g. be a `Memory` rather than a `Vector`.
I've added tests and updated the docstrings for all three functions to
ensure that they're not just restricted to `Vector{UInt8}`.
This change was prompted by our private codebase hitting `MethodError:
no method matching writeshortest(::Memory{UInt8}, ::Int64, ::Float64,
...)` when trying it out with Julia v1.12.0-DEV.
(cc @quinnj -- i think you added this method originally, but i couldn't
see any reason why e.g. Memory shouldn't be allowed now we have it)Ryu.writeshortest (JuliaLang#57172)1 parent eff8ba4 commit 8560318
3 files changed
+55
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
373 | 390 | | |
374 | 391 | | |
375 | 392 | | |
| |||
563 | 580 | | |
564 | 581 | | |
565 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
566 | 600 | | |
567 | 601 | | |
568 | 602 | | |
| |||
761 | 795 | | |
762 | 796 | | |
763 | 797 | | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
764 | 815 | | |
765 | 816 | | |
766 | 817 | | |
| |||
0 commit comments