1
Fork 0

Implement Deref<LayoutS> for Layout

This commit is contained in:
Lukas Wirth 2023-09-29 18:00:06 +02:00
parent 67e5eb6cec
commit 6d141c11c0
4 changed files with 11 additions and 4 deletions

View file

@ -73,6 +73,13 @@ impl<'a> fmt::Debug for Layout<'a> {
}
}
impl<'a> Deref for Layout<'a> {
type Target = &'a LayoutS<FieldIdx, VariantIdx>;
fn deref(&self) -> &&'a LayoutS<FieldIdx, VariantIdx> {
&self.0.0
}
}
impl<'a> Layout<'a> {
pub fn fields(self) -> &'a FieldsShape<FieldIdx> {
&self.0.0.fields