Implement Deref<LayoutS> for Layout
This commit is contained in:
parent
67e5eb6cec
commit
6d141c11c0
4 changed files with 11 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue