Use RPIT to get static dispatch GetStandardProperties.

This commit is contained in:
Tom Alexander 2023-10-31 21:04:46 -04:00
parent 31fb815681
commit 49f6e70a19
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -10,3 +10,14 @@ impl<'s, I: StandardProperties<'s>> GetStandardProperties<'s> for I {
self
}
}
pub trait NewGetStandardProperties<'s> {
// TODO: Can I eliminate this dynamic dispatch, perhaps using nominal generic structs? Low prioritiy since this is not used during parsing.
fn get_standard_properties(self) -> impl StandardProperties<'s>;
}
impl<'s, I: StandardProperties<'s>> NewGetStandardProperties<'s> for I {
fn get_standard_properties(self) -> impl StandardProperties<'s> {
self
}
}