From babd9c7e7121f643108f62abdcd100261742dc11 Mon Sep 17 00:00:00 2001 From: wandalen Date: Sun, 24 Mar 2024 00:35:14 +0200 Subject: [PATCH] former : experimenting --- module/core/former/src/axiomatic.rs | 2 ++ module/core/former/src/vector.rs | 3 ++- .../former/tests/inc/former_tests/container_former_vec.rs | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/module/core/former/src/axiomatic.rs b/module/core/former/src/axiomatic.rs index af916d18ae..3b8cfaef2c 100644 --- a/module/core/former/src/axiomatic.rs +++ b/module/core/former/src/axiomatic.rs @@ -93,6 +93,8 @@ impl< Definition, T > FormingEnd< Definition > for ReturnStorage where Definition : FormerDefinition< Context = (), Storage = T, Formed = T, End = Self >, + Definition::End : FormingEnd< Definition >, + // Definition::End : Self, // Definition::Storage : Default, { #[ inline( always ) ] diff --git a/module/core/former/src/vector.rs b/module/core/former/src/vector.rs index 05c695b712..99132431a6 100644 --- a/module/core/former/src/vector.rs +++ b/module/core/former/src/vector.rs @@ -48,7 +48,8 @@ for Vec< E > // pub struct VectorDefinition< E, Context = (), End = ReturnStorage > pub struct VectorDefinition< E, Context, End > where - End : FormingEnd< Self > + End : FormingEnd< Self >, + Self : FormerDefinition, { _phantom : core::marker::PhantomData< ( E, Context, End ) >, } diff --git a/module/core/former/tests/inc/former_tests/container_former_vec.rs b/module/core/former/tests/inc/former_tests/container_former_vec.rs index f91b48c8b8..1e9bc00448 100644 --- a/module/core/former/tests/inc/former_tests/container_former_vec.rs +++ b/module/core/former/tests/inc/former_tests/container_former_vec.rs @@ -22,6 +22,12 @@ where { } +// impl former::FormingEnd> for former::ReturnStorage { +// fn call(&self, storage: former::VectorDefinition::Storage, context: Option::Context>) -> former::VectorDefinition::Formed { +// storage +// } +// } + #[ test ] fn push() {