Commit 276bb9c
feat(encoding): encode usize and isize (#282)
Implement `EncodeGaugeValue` for `usize` and `isize`, and
`EncodeCounterValue` for `usize`. This is very straight forward and the
argument is the same as the one for `EncodeGaugeValue for u64`; if you
don't do this the user code will get littered with `as i64`/`as u64`.
Since these conversions are infallible for `32-bit` platforms, and have
the same issues as the current `u64` impl for `64-bit` platforms, I
don't think there is any problem with adding them.
Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
Signed-off-by: Max Inden <mail@max-inden.de>
Co-authored-by: Max Inden <mail@max-inden.de>1 parent 3942d06 commit 276bb9c
2 files changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
621 | 636 | | |
622 | 637 | | |
623 | 638 | | |
| |||
686 | 701 | | |
687 | 702 | | |
688 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
689 | 711 | | |
690 | 712 | | |
691 | 713 | | |
| |||
0 commit comments