Commit ca8decb
committed
feat(encoding): encode usize and isize
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 <[email protected]>1 parent 6bb0b10 commit ca8decb
2 files changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
610 | 625 | | |
611 | 626 | | |
612 | 627 | | |
| |||
675 | 690 | | |
676 | 691 | | |
677 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
678 | 700 | | |
679 | 701 | | |
680 | 702 | | |
| |||
0 commit comments