Convert try! to ? in extfunc.rs
This commit is contained in:
@@ -34,9 +34,9 @@ fn write_list(f: &mut Formatter, args: &Vec<ArgumentType>) -> fmt::Result {
|
|||||||
match args.split_first() {
|
match args.split_first() {
|
||||||
None => {}
|
None => {}
|
||||||
Some((first, rest)) => {
|
Some((first, rest)) => {
|
||||||
try!(write!(f, "{}", first));
|
write!(f, "{}", first)?;
|
||||||
for arg in rest {
|
for arg in rest {
|
||||||
try!(write!(f, ", {}", arg));
|
write!(f, ", {}", arg)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,12 +45,12 @@ fn write_list(f: &mut Formatter, args: &Vec<ArgumentType>) -> fmt::Result {
|
|||||||
|
|
||||||
impl Display for Signature {
|
impl Display for Signature {
|
||||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||||
try!(write!(f, "("));
|
write!(f, "(")?;
|
||||||
try!(write_list(f, &self.argument_types));
|
write_list(f, &self.argument_types)?;
|
||||||
try!(write!(f, ")"));
|
write!(f, ")")?;
|
||||||
if !self.return_types.is_empty() {
|
if !self.return_types.is_empty() {
|
||||||
try!(write!(f, " -> "));
|
write!(f, " -> ")?;
|
||||||
try!(write_list(f, &self.return_types));
|
write_list(f, &self.return_types)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -83,14 +83,14 @@ impl ArgumentType {
|
|||||||
|
|
||||||
impl Display for ArgumentType {
|
impl Display for ArgumentType {
|
||||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||||
try!(write!(f, "{}", self.value_type));
|
write!(f, "{}", self.value_type)?;
|
||||||
match self.extension {
|
match self.extension {
|
||||||
ArgumentExtension::None => {}
|
ArgumentExtension::None => {}
|
||||||
ArgumentExtension::Uext => try!(write!(f, " uext")),
|
ArgumentExtension::Uext => write!(f, " uext")?,
|
||||||
ArgumentExtension::Sext => try!(write!(f, " sext")),
|
ArgumentExtension::Sext => write!(f, " sext")?,
|
||||||
}
|
}
|
||||||
if self.inreg {
|
if self.inreg {
|
||||||
try!(write!(f, " inreg"));
|
write!(f, " inreg")?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user