Created
February 2, 2022 03:14
-
-
Save 1Firsts/3e5bb94452844cfbb603d18204eeb0b2 to your computer and use it in GitHub Desktop.
The next 4 bytes will be the amount.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let amount = rest_of_data | |
.get(..8) | |
.and_then(|slice| slice.try_into().ok()) | |
.map(u64::from_le_bytes) | |
.unwrap(); | |
let description = String::from_utf8(rest_of_data[9..].to_vec()).unwrap(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment