wip: staticify?
This commit is contained in:
1 parent
78d093a945
commit
5ad81885e4
21 files changed
+433
-346
No files matched your search
@@ -11,7 +11,9 @@ pub type ScopeIdx = generational_arena::Index;
|
||||
|
||||
pub trait Properties: PartialEq {
|
||||
type Builder;
|
||||
type StaticOutput: Properties + 'static;
|
||||
fn builder() -> Self::Builder;
|
||||
unsafe fn into_static(self) -> Self::StaticOutput;
|
||||
}
|
||||
|
||||
pub struct EmptyBuilder;
|
||||
@@ -23,10 +25,15 @@ impl EmptyBuilder {
|
||||
|
||||
impl Properties for () {
|
||||
type Builder = EmptyBuilder;
|
||||
type StaticOutput = ();
|
||||
|
||||
fn builder() -> Self::Builder {
|
||||
EmptyBuilder {}
|
||||
}
|
||||
|
||||
unsafe fn into_static(self) -> Self::StaticOutput {
|
||||
std::mem::transmute(self)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fc_to_builder<T: Properties>(_f: FC<T>) -> T::Builder {
|
||||
|
||||
Reference in new issue
Block a user