From 700c049f64b66f424cda5da3021dfce4462655ca Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 21 Jul 2026 05:49:00 +0800 Subject: feat(core): add generic parameter `C` to `StructuralData` trait Make `StructuralData` and `StructuralDataSealed` generic over a program collector type to bypass the orphan rule for `group_structural!`. This enables external types to implement `StructuralData` without violating coherence. --- mingling_core/tests/test-all/tests/integration.rs | 9 +++++---- .../tests/test-structural-renderer/tests/integration.rs | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'mingling_core/tests') diff --git a/mingling_core/tests/test-all/tests/integration.rs b/mingling_core/tests/test-all/tests/integration.rs index 08703b0..d36b9df 100644 --- a/mingling_core/tests/test-all/tests/integration.rs +++ b/mingling_core/tests/test-all/tests/integration.rs @@ -1,5 +1,4 @@ use mingling::Flag; -use mingling::MockProgramCollect; use mingling::NextProcess; use mingling::Node; use mingling::Program; @@ -125,13 +124,13 @@ fn test_structural_renderer_json() { #[test] fn test_is_completing() { - let program: Program = Program::new_with_args(["app", "__comp"]); + let program: Program = Program::new_with_args(["app", "__comp"]); assert!(program.is_completing()); } #[test] fn test_is_not_completing() { - let program: Program = Program::new_with_args(["app", "greet"]); + let program: Program = Program::new_with_args(["app", "greet"]); assert!(!program.is_completing()); } @@ -141,7 +140,7 @@ fn test_is_not_completing() { fn test_hook_setup() { static CALLED: AtomicBool = AtomicBool::new(false); - let hook = ProgramHook::::empty().on_begin::<_, ()>(|_| { + let hook = ProgramHook::::empty().on_begin::<_, ()>(|_| { CALLED.store(true, Ordering::SeqCst); }); @@ -166,3 +165,5 @@ fn test_string_vec_from_array() { let v: Vec = sv.into(); assert_eq!(v, vec!["a", "b", "c"]); } + +mingling::macros::gen_program!(); diff --git a/mingling_core/tests/test-structural-renderer/tests/integration.rs b/mingling_core/tests/test-structural-renderer/tests/integration.rs index 0bcf53a..e4057f8 100644 --- a/mingling_core/tests/test-structural-renderer/tests/integration.rs +++ b/mingling_core/tests/test-structural-renderer/tests/integration.rs @@ -74,3 +74,6 @@ fn test_render_ron() { assert!(output.contains("value:")); assert!(output.contains("42")); } + +mingling::macros::gen_program!(); + -- cgit