projects
/
nihav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f7e937
)
byteio: update syntax
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Tue, 11 Dec 2018 12:58:38 +0000
(13:58 +0100)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Tue, 11 Dec 2018 12:58:38 +0000
(13:58 +0100)
src/io/byteio.rs
patch
|
blob
|
blame
|
history
diff --git
a/src/io/byteio.rs
b/src/io/byteio.rs
index e172a325d223e19ff512a6f553b9c4aa083293f1..966169cdefa00756767c79a500cd64ef70499064 100644
(file)
--- a/
src/io/byteio.rs
+++ b/
src/io/byteio.rs
@@
-48,7
+48,7
@@
pub struct FileReader<'a> {
macro_rules! read_int {
($s: ident, $inttype: ty, $size: expr, $which: ident) => ({
let mut buf = [0; $size];
-
try!($s.read_buf(&mut buf))
;
+
$s.read_buf(&mut buf)?
;
unsafe {
Ok((*(buf.as_ptr() as *const $inttype)).$which())
}
@@
-58,7
+58,7
@@
macro_rules! read_int {
macro_rules! peek_int {
($s: ident, $inttype: ty, $size: expr, $which: ident) => ({
let mut buf = [0; $size];
-
try!($s.peek_buf(&mut buf))
;
+
$s.peek_buf(&mut buf)?
;
unsafe {
Ok((*(buf.as_ptr() as *const $inttype)).$which())
}