diff --git a/codegen/src/attrs.rs b/codegen/src/attrs.rs index 32d258f7..eb8d999a 100644 --- a/codegen/src/attrs.rs +++ b/codegen/src/attrs.rs @@ -32,7 +32,10 @@ pub struct ExportInfo { pub fn parse_attr_items(args: ParseStream) -> syn::Result { 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 .call(syn::punctuated::Punctuated::::parse_separated_nonempty)?; @@ -80,10 +83,17 @@ pub fn parse_punctuated_items( .ok_or_else(|| syn::Error::new(attr_path.span(), "expecting attribute name"))?, 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( diff --git a/codegen/tests/test_nested.rs b/codegen/tests/test_nested.rs index f0144990..4d0d39aa 100644 --- a/codegen/tests/test_nested.rs +++ b/codegen/tests/test_nested.rs @@ -187,7 +187,6 @@ fn export_nested_by_prefix_test() -> Result<(), Box> { if s == "math::bar_fourth_adders::add_int (i64, i64)" && p == rhai::Position::new(3, 42))); - assert!(matches!(*engine.eval::( r#"import "Math::Advanced" as math; let ex = 41.0;