Converts all try! macros to ? syntax.

Fixes #46
This commit is contained in:
rep-nop
2017-02-25 22:12:33 -05:00
committed by Jakob Stoklund Olesen
parent cf5701b137
commit b23f1fb347
22 changed files with 270 additions and 270 deletions

View File

@@ -265,9 +265,9 @@ impl Display for VariableArgs {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
for (i, val) in self.0.iter().enumerate() {
if i == 0 {
try!(write!(fmt, "{}", val));
write!(fmt, "{}", val)?;
} else {
try!(write!(fmt, ", {}", val));
write!(fmt, ", {}", val)?;
}
}
Ok(())
@@ -289,9 +289,9 @@ pub struct UnaryImmVectorData {
impl Display for UnaryImmVectorData {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
try!(write!(f, "#"));
write!(f, "#")?;
for b in &self.imm {
try!(write!(f, "{:02x}", b));
write!(f, "{:02x}", b)?;
}
Ok(())
}
@@ -356,9 +356,9 @@ impl BranchData {
impl Display for BranchData {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
try!(write!(f, "{}, {}", self.arg, self.destination));
write!(f, "{}, {}", self.arg, self.destination)?;
if !self.varargs.is_empty() {
try!(write!(f, "({})", self.varargs));
write!(f, "({})", self.varargs)?;
}
Ok(())
}