Replace try! macro

This commit is contained in:
Eirik Ogilvie-Wigley 2019-08-20 18:24:47 -06:00
parent 7809711a81
commit b35a819a09
2 changed files with 6 additions and 6 deletions

View File

@ -122,9 +122,9 @@ fn prime_field_repr_impl(repr: &syn::Ident, limbs: usize) -> proc_macro2::TokenS
impl ::std::fmt::Debug for #repr
{
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
try!(write!(f, "0x"));
write!(f, "0x")?;
for i in self.0.iter().rev() {
try!(write!(f, "{:016x}", *i));
write!(f, "{:016x}", *i)?;
}
Ok(())
@ -133,9 +133,9 @@ fn prime_field_repr_impl(repr: &syn::Ident, limbs: usize) -> proc_macro2::TokenS
impl ::std::fmt::Display for #repr {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
try!(write!(f, "0x"));
write!(f, "0x")?;
for i in self.0.iter().rev() {
try!(write!(f, "{:016x}", *i));
write!(f, "{:016x}", *i)?;
}
Ok(())

View File

@ -75,9 +75,9 @@ pub struct FsRepr(pub [u64; 4]);
impl ::std::fmt::Display for FsRepr {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
r#try!(write!(f, "0x"));
r#write!(f, "0x")?;
for i in self.0.iter().rev() {
r#try!(write!(f, "{:016x}", *i));
r#write!(f, "{:016x}", *i)?;
}
Ok(())