Run cargo fmt for loose ends

This commit is contained in:
J Henry Waugh 2020-09-20 12:37:37 -05:00
parent e89cec2829
commit c389014df7
2 changed files with 13 additions and 4 deletions

View File

@ -32,7 +32,10 @@ pub struct ExportInfo {
pub fn parse_attr_items(args: ParseStream) -> syn::Result<ExportInfo> { pub fn parse_attr_items(args: ParseStream) -> syn::Result<ExportInfo> {
if args.is_empty() { if args.is_empty() {
return Ok(ExportInfo { item_span: args.span(), items: Vec::new()}); return Ok(ExportInfo {
item_span: args.span(),
items: Vec::new(),
});
} }
let arg_list = args let arg_list = args
.call(syn::punctuated::Punctuated::<syn::Expr, syn::Token![,]>::parse_separated_nonempty)?; .call(syn::punctuated::Punctuated::<syn::Expr, syn::Token![,]>::parse_separated_nonempty)?;
@ -80,10 +83,17 @@ pub fn parse_punctuated_items(
.ok_or_else(|| syn::Error::new(attr_path.span(), "expecting attribute name"))?, .ok_or_else(|| syn::Error::new(attr_path.span(), "expecting attribute name"))?,
x => return Err(syn::Error::new(x.span(), "expecting identifier")), x => return Err(syn::Error::new(x.span(), "expecting identifier")),
}; };
attrs.push(AttrItem { key, value, span: arg_span }); attrs.push(AttrItem {
key,
value,
span: arg_span,
});
} }
Ok(ExportInfo { item_span: list_span, items: attrs }) Ok(ExportInfo {
item_span: list_span,
items: attrs,
})
} }
pub(crate) fn outer_item_attributes<T: ExportedParams>( pub(crate) fn outer_item_attributes<T: ExportedParams>(

View File

@ -187,7 +187,6 @@ fn export_nested_by_prefix_test() -> Result<(), Box<EvalAltResult>> {
if s == "math::bar_fourth_adders::add_int (i64, i64)" if s == "math::bar_fourth_adders::add_int (i64, i64)"
&& p == rhai::Position::new(3, 42))); && p == rhai::Position::new(3, 42)));
assert!(matches!(*engine.eval::<FLOAT>( assert!(matches!(*engine.eval::<FLOAT>(
r#"import "Math::Advanced" as math; r#"import "Math::Advanced" as math;
let ex = 41.0; let ex = 41.0;