Skip to content

Commit

Permalink
Use ? instead of deprecated try!
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Sep 3, 2019
1 parent a473fe3 commit 50f6197
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions benches/shootout-pidigits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ fn pidigits(n: isize, out: &mut dyn io::Write) -> io::Result<()> {
}
}

try!(write!(out, "{}", d));
write!(out, "{}", d)?;
if i % 10 == 0 {
try!(write!(out, "\t:{}\n", i));
write!(out, "\t:{}\n", i)?;
}

context.eliminate_digit(d);
Expand All @@ -120,9 +120,9 @@ fn pidigits(n: isize, out: &mut dyn io::Write) -> io::Result<()> {
let m = n % 10;
if m != 0 {
for _ in m..10 {
try!(write!(out, " "));
write!(out, " ")?;
}
try!(write!(out, "\t:{}\n", n));
write!(out, "\t:{}\n", n)?;
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ impl Num for BigInt {
} else {
Plus
};
let bu = try!(BigUint::from_str_radix(s, radix));
let bu = BigUint::from_str_radix(s, radix)?;
Ok(BigInt::from_biguint(sign, bu))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/biguint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,7 @@ impl<'de> serde::Deserialize<'de> for BigUint {
where
D: serde::Deserializer<'de>,
{
let data: Vec<u32> = try!(Vec::deserialize(deserializer));
let data: Vec<u32> = Vec::deserialize(deserializer)?;
Ok(BigUint::new(data))
}
}
Expand Down

0 comments on commit 50f6197

Please sign in to comment.