Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert between integer and byte array #103

Open
wants to merge 6 commits into
base: master
from

Conversation

@flier
Copy link

commented Feb 28, 2019

After Rust 1.32, the function to_<endian>_bytes and from_<endian>_bytes has stabilizations.

Cargo.toml Outdated Show resolved Hide resolved
build.rs Outdated Show resolved Hide resolved
src/int.rs Outdated Show resolved Hide resolved

flier added some commits Mar 1, 2019

@flier

This comment has been minimized.

Copy link
Author

commented Mar 5, 2019

Tests seem crashed at src/int.rs - int::PrimInt::unsigned_shr (line 173)

---- src/int.rs - int::PrimInt::unsigned_shr (line 173) stdout ----
error: literal out of range for i64
 --> src/int.rs:176:9
  |
6 | let n = 0xFEDCBA9876543210i64;
  |         ^^^^^^^^^^^^^^^^^^^^^ help: consider using `u64` instead: `0xFEDCBA9876543210u64`
  |
  = note: #[deny(overflowing_literals)] on by default
  = note: the literal `0xFEDCBA9876543210i64` (decimal `18364758544493064720`) does not fit into an `i64` and will become `-81985529216486896i64`
thread 'src/int.rs - int::PrimInt::unsigned_shr (line 173)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:351:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.