formatting cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-06-10 20:05:51 +02:00
parent 7db28deaff
commit 1c1c8530c5
2 changed files with 7 additions and 13 deletions

View File

@ -78,10 +78,7 @@ fn handle_function(
.remove("body") .remove("body")
.map(|v| v.expect_type()) .map(|v| v.expect_type())
.transpose()? .transpose()?
.map_or_else( .map_or_else(|| quote! { ::hyper::Body }, |v| v.into_token_stream());
|| quote! { ::hyper::Body },
|v| v.into_token_stream(),
);
let vis = std::mem::replace(&mut item.vis, syn::Visibility::Inherited); let vis = std::mem::replace(&mut item.vis, syn::Visibility::Inherited);
let span = item.ident.span(); let span = item.ident.span();

View File

@ -149,9 +149,9 @@ impl Expression {
Expr::Lit(lit) => match lit.lit { Expr::Lit(lit) => match lit.lit {
Lit::Str(lit) => Ok(lit), Lit::Str(lit) => Ok(lit),
other => bail!("expected string literal, got: {:?}", other), other => bail!("expected string literal, got: {:?}", other),
} },
other => bail!("expected string literal, got: {:?}", other), other => bail!("expected string literal, got: {:?}", other),
} },
_ => bail!("expected string literal"), _ => bail!("expected string literal"),
} }
} }
@ -162,9 +162,9 @@ impl Expression {
Expr::Lit(lit) => match lit.lit { Expr::Lit(lit) => match lit.lit {
Lit::Bool(lit) => Ok(lit), Lit::Bool(lit) => Ok(lit),
other => bail!("expected boolean literal, got: {:?}", other), other => bail!("expected boolean literal, got: {:?}", other),
} },
other => bail!("expected boolean literal, got: {:?}", other), other => bail!("expected boolean literal, got: {:?}", other),
} },
_ => bail!("expected boolean literal"), _ => bail!("expected boolean literal"),
} }
} }
@ -188,7 +188,7 @@ impl Expression {
Expression::Expr(expr) => match expr { Expression::Expr(expr) => match expr {
Expr::Path(path) => Ok(path), Expr::Path(path) => Ok(path),
other => bail!("expected a type name, got {:?}", other), other => bail!("expected a type name, got {:?}", other),
} },
_ => bail!("expected a type name, got {:?}", self), _ => bail!("expected a type name, got {:?}", self),
} }
} }
@ -273,10 +273,7 @@ fn need_ident_or_string(tokens: &mut TokenIter) -> Result<Name, Error> {
_ => bail!("expected ident or string as key: {:?}", span), _ => bail!("expected ident or string as key: {:?}", span),
} }
} }
Some(other) => bail!( Some(other) => bail!("expected an identifier or a string: {:?}", other.span()),
"expected an identifier or a string: {:?}",
other.span()
),
None => bail!("ident expected"), None => bail!("ident expected"),
} }
} }