Skip to content

Commit

Permalink
former : evolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Apr 20, 2024
1 parent 8a38d83 commit 1edb9e7
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions module/core/former/tests/inc/former_tests/subformer_extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,22 +248,15 @@ where

//

/// xxx : extend description
/// Convert an entity to an element which could be added to a container.
pub trait IntoElement< Element >
{
/// Convert an entity to an element which could be added to a container.
fn into_element( self ) -> Element;
}

impl< K > IntoElement< ( String, Command< K > ) >
for Command< K >
impl< K > From< Command< K > >
for ( String, Command< K > )
where
K : core::hash::Hash + std::cmp::Eq,
{
fn into_element( self ) -> ( String, Command< K > )
#[ inline( always ) ]
fn from( src : Command< K > ) -> Self
{
( self.name.clone(), self )
( src.name.clone(), src )
}
}

Expand Down Expand Up @@ -370,7 +363,8 @@ where
>,
SubDefinition::Storage : former::StoragePreform< Preformed = SubFormed >,

SubFormed : IntoElement< Element >,
// SubFormed : IntoElement< Element >,
SubFormed : Into< Element >,
{

#[ inline( always ) ]
Expand All @@ -394,7 +388,7 @@ where
former::ContainerAdd::add
(
container,
IntoElement::< Element >::into_element( storage ),
Into::< Element >::into( storage ),
);

super_former
Expand Down

0 comments on commit 1edb9e7

Please sign in to comment.