diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2018-06-29 22:46:20 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2018-08-03 07:55:10 +0200 |
| commit | a04b2cda0bf2f6f8c5c0a483b8f3356bde1cbd80 (patch) | |
| tree | d4d22b6917d878bf8fbcf276a4593d34c5ab0cb1 /src/test/incremental/thinlto | |
| parent | 7e8ca9f8bd8325398e76bc30ac09aab138bbb127 (diff) | |
| download | rust-a04b2cda0bf2f6f8c5c0a483b8f3356bde1cbd80.tar.gz rust-a04b2cda0bf2f6f8c5c0a483b8f3356bde1cbd80.zip | |
Provide `{to,from}_{ne,le,be}_bytes` functions on integers
If one doesn't view integers as containers of bytes, converting them to
bytes necessarily needs the specfication of encoding.
I think Rust is a language that wants to be explicit. The `to_bytes`
function is basically the opposite of that – it converts an integer into
the native byte representation, but there's no mention (in the function
name) of it being very much platform dependent. Therefore, I think it
would be better to replace that method by three methods, the explicit
`to_ne_bytes` ("native endian") which does the same thing and
`to_{le,be}_bytes` which return the little- resp. big-endian encoding.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
