Use question mark operator instead of try macro with a raw identifier

Co-Authored-By: SimonSapin <simon.sapin@exyr.org>
This commit is contained in:
Keith Yeung 2018-11-02 08:51:48 +01:00 committed by Simon Sapin
parent 99cd7ba3d4
commit 8757cf5bc0

View file

@ -342,7 +342,7 @@ macro_rules! define_resource_id {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: ::serde::Deserializer<'de>
{
let id = r#try!(u32::deserialize(deserializer));
let id = u32::deserialize(deserializer)?;
if id == 0 {
Err(::serde::de::Error::custom("expected a non-zero value"))
} else {