Skip to content

Commit

Permalink
chore: add AsRef for Code for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
jac3km4 committed Jan 10, 2024
1 parent 22aecd7 commit c96c139
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,13 @@ impl<Loc: Clone> Code<Loc> {
}
}

impl<Loc> AsRef<[Instr<Loc>]> for Code<Loc> {
#[inline]
fn as_ref(&self) -> &[Instr<Loc>] {
&self.0
}
}

impl<Loc> AsMut<[Instr<Loc>]> for Code<Loc> {
#[inline]
fn as_mut(&mut self) -> &mut [Instr<Loc>] {
Expand Down

0 comments on commit c96c139

Please sign in to comment.