diff options
| author | kennytm <kennytm@gmail.com> | 2018-08-04 17:19:38 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-08-04 17:19:38 +0800 |
| commit | 52db0ed161cd917908356cdd02624f9dd300966b (patch) | |
| tree | 9f380d2c15da850a8e6a0eb386993e9d574f1cb8 /src/test/incremental/thinlto | |
| parent | aefa307c1fce043062d9d811f91476c0b22c6a6d (diff) | |
| parent | 0ddfae5ba2d0104a33f3a7162571b761458f0464 (diff) | |
| download | rust-52db0ed161cd917908356cdd02624f9dd300966b.tar.gz rust-52db0ed161cd917908356cdd02624f9dd300966b.zip | |
Rollup merge of #51919 - tbu-:pr_num_to_from_bytes2, r=SimonSapin
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
