fixes to allow benchmarks to be run for core (#122)

cargo +nightly bench -p grin_core
This commit is contained in:
AntiochP 2017-09-12 13:20:01 -04:00 committed by Ignotus Peverell
parent 87cd0e5c58
commit 4aea4d0548

View file

@ -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)
} }