From 233e60e231c33b3e3a082016f3e72a34cf69cf0c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 1 Jan 2021 22:12:50 -0800 Subject: [PATCH] Resolve unnecessary_wraps clippy lint --- syntax/parse.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/syntax/parse.rs b/syntax/parse.rs index acf969d3..9d847992 100644 --- a/syntax/parse.rs +++ b/syntax/parse.rs @@ -39,10 +39,7 @@ pub fn parse_items( Ok(strct) => apis.push(strct), Err(err) => cx.push(err), }, - Item::Enum(item) => match parse_enum(cx, item, namespace) { - Ok(enm) => apis.push(enm), - Err(err) => cx.push(err), - }, + Item::Enum(item) => apis.push(parse_enum(cx, item, namespace)), Item::ForeignMod(foreign_mod) => { parse_foreign_mod(cx, foreign_mod, &mut apis, trusted, namespace) } @@ -153,7 +150,7 @@ fn parse_struct(cx: &mut Errors, mut item: ItemStruct, namespace: &Namespace) -> })) } -fn parse_enum(cx: &mut Errors, item: ItemEnum, namespace: &Namespace) -> Result { +fn parse_enum(cx: &mut Errors, item: ItemEnum, namespace: &Namespace) -> Api { let mut doc = Doc::new(); let mut derives = Vec::new(); let mut repr = None; @@ -218,7 +215,7 @@ fn parse_enum(cx: &mut Errors, item: ItemEnum, namespace: &Namespace) -> Result< gt_token: None, }; - Ok(Api::Enum(Enum { + Api::Enum(Enum { doc, derives, attrs, @@ -231,7 +228,7 @@ fn parse_enum(cx: &mut Errors, item: ItemEnum, namespace: &Namespace) -> Result< repr, repr_type, explicit_repr, - })) + }) } fn parse_variant(