mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Standardize serialization within the Monero lib
read for R: Read
write for W: Write
serialize for -> Vec<u8>
Also uses std::io::{self, Read, Write} consistently.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::io;
|
||||
use std::io::{self, Write};
|
||||
|
||||
const VARINT_CONTINUATION_MASK: u8 = 0b1000_0000;
|
||||
pub(crate) fn write_varint<W: io::Write>(varint: &u64, w: &mut W) -> io::Result<()> {
|
||||
pub(crate) fn write_varint<W: Write>(varint: &u64, w: &mut W) -> io::Result<()> {
|
||||
let mut varint = *varint;
|
||||
while {
|
||||
let mut b = u8::try_from(varint & u64::from(!VARINT_CONTINUATION_MASK)).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user