Fixed block import (#368)

* Fixed decoding from file

* Increased progress frequency
This commit is contained in:
Arkadiy Paronyan
2018-07-18 15:03:30 +02:00
committed by Gav Wood
parent 4dfa17ab37
commit 8bcfb16fad
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -49,7 +49,10 @@ impl<'a> Input for &'a [u8] {
#[cfg(feature = "std")]
impl<R: ::std::io::Read> Input for R {
fn read(&mut self, into: &mut [u8]) -> usize {
(self as &mut ::std::io::Read).read(into).unwrap_or(0)
match (self as &mut ::std::io::Read).read_exact(into) {
Ok(()) => into.len(),
Err(_) => 0,
}
}
}