From 1c1c8530c55c74e948e46a5d59ef8ae47a1242cb Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 10 Jun 2019 20:05:51 +0200 Subject: [PATCH] formatting cleanup Signed-off-by: Wolfgang Bumiller --- proxmox-api-macro/src/api_macro.rs | 5 +---- proxmox-api-macro/src/parsing.rs | 15 ++++++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/proxmox-api-macro/src/api_macro.rs b/proxmox-api-macro/src/api_macro.rs index d93264f9..5b37cba8 100644 --- a/proxmox-api-macro/src/api_macro.rs +++ b/proxmox-api-macro/src/api_macro.rs @@ -78,10 +78,7 @@ fn handle_function( .remove("body") .map(|v| v.expect_type()) .transpose()? - .map_or_else( - || quote! { ::hyper::Body }, - |v| v.into_token_stream(), - ); + .map_or_else(|| quote! { ::hyper::Body }, |v| v.into_token_stream()); let vis = std::mem::replace(&mut item.vis, syn::Visibility::Inherited); let span = item.ident.span(); diff --git a/proxmox-api-macro/src/parsing.rs b/proxmox-api-macro/src/parsing.rs index c46990e2..4e80228b 100644 --- a/proxmox-api-macro/src/parsing.rs +++ b/proxmox-api-macro/src/parsing.rs @@ -149,9 +149,9 @@ impl Expression { Expr::Lit(lit) => match lit.lit { Lit::Str(lit) => Ok(lit), other => bail!("expected string literal, got: {:?}", other), - } + }, other => bail!("expected string literal, got: {:?}", other), - } + }, _ => bail!("expected string literal"), } } @@ -162,9 +162,9 @@ impl Expression { Expr::Lit(lit) => match lit.lit { Lit::Bool(lit) => Ok(lit), other => bail!("expected boolean literal, got: {:?}", other), - } + }, other => bail!("expected boolean literal, got: {:?}", other), - } + }, _ => bail!("expected boolean literal"), } } @@ -188,7 +188,7 @@ impl Expression { Expression::Expr(expr) => match expr { Expr::Path(path) => Ok(path), other => bail!("expected a type name, got {:?}", other), - } + }, _ => bail!("expected a type name, got {:?}", self), } } @@ -273,10 +273,7 @@ fn need_ident_or_string(tokens: &mut TokenIter) -> Result { _ => bail!("expected ident or string as key: {:?}", span), } } - Some(other) => bail!( - "expected an identifier or a string: {:?}", - other.span() - ), + Some(other) => bail!("expected an identifier or a string: {:?}", other.span()), None => bail!("ident expected"), } }