Big integers (Uint*) from byte slice array with from_be_bytes#436
Big integers (Uint*) from byte slice array with from_be_bytes#436apoelstra merged 2 commits intorust-bitcoin:masterfrom BP-WG:feat-u256u8
from_be_bytes#436Conversation
|
Could you please implement this without heap allocations? rust-bitcoin/src/util/endian.rs Line 54 in f4e26ca |
stevenroose
left a comment
There was a problem hiding this comment.
Hmm, it reads correctly, but I'd be happier with a unit test.
@elichai I did, but it fails to compile since this function is not being used from anywhere (i.e. triggers error: function is never used: `slice_to_u64_be`
--> src/util/endian.rs:4:9
|
4 | pub fn $name(slice: &[u8]) -> $type {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
55 | define_slice_to_be!(slice_to_u64_be, u64);
| ------------------------------------------ in this macro invocation
|
note: the lint level is defined here
--> src/lib.rs:43:9
|
43 | #![deny(dead_code)]
| ^^^^^^^^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) |
|
I meant that you'll use that instead of: |
|
Oh yes, true |
|
done |
|
Now, with #435 merged, it will be nice to merge this one as well before the next version release |
sgeisler
left a comment
There was a problem hiding this comment.
Looks good. I think it could be more readable/idiomatic if it used iterators.
Co-authored-by: Sebastian <geisler.sebastian@googlemail.com>
|
Btw, trying to understand how Updt: created an issue for that #467 This can be fixed independently from this PR |
No description provided.