Run cargo fmt for loose ends
This commit is contained in:
parent
e89cec2829
commit
c389014df7
@ -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>(
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user