mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
fixes to allow benchmarks to be run for core (#122)
cargo +nightly bench -p grin_core
This commit is contained in:
parent
87cd0e5c58
commit
4aea4d0548
1 changed files with 2 additions and 2 deletions
|
@ -187,13 +187,13 @@ pub trait Readable
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserializes a Readeable from any std::io::Read implementation.
|
/// Deserializes a Readeable from any std::io::Read implementation.
|
||||||
pub fn deserialize<T: Readable>(mut source: &mut Read) -> Result<T, Error> {
|
pub fn deserialize<T: Readable>(source: &mut Read) -> Result<T, Error> {
|
||||||
let mut reader = BinReader { source: source };
|
let mut reader = BinReader { source: source };
|
||||||
T::read(&mut reader)
|
T::read(&mut reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Serializes a Writeable into any std::io::Write implementation.
|
/// Serializes a Writeable into any std::io::Write implementation.
|
||||||
pub fn serialize<W: Writeable>(mut sink: &mut Write, thing: &W) -> Result<(), Error> {
|
pub fn serialize<W: Writeable>(sink: &mut Write, thing: &W) -> Result<(), Error> {
|
||||||
let mut writer = BinWriter { sink: sink };
|
let mut writer = BinWriter { sink: sink };
|
||||||
thing.write(&mut writer)
|
thing.write(&mut writer)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue