Skip to content

Commit

Permalink
unwrap_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
enricozb committed Apr 4, 2024
1 parent fcf74e6 commit 9a22ad5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/run/interact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl<'a, M: Mode> Net<'a, M> {
pub fn op_num(&mut self, a: Port, b: Port) {
trace!(self.tracer, a, b);
let a = a.consume_node();
let op = Op::try_from(a.lab).unwrap();
let op = unsafe { Op::try_from(a.lab).unwrap_unchecked() };
let a1 = a.p1.load_target();
if a1.tag() == Num {
self.rwts.oper += 1;
Expand Down
2 changes: 1 addition & 1 deletion src/run/port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Port {
/// ports.
#[inline(always)]
pub fn op(&self) -> Op {
self.lab().try_into().unwrap()
unsafe { self.lab().try_into().unwrap_unchecked() }
}

/// Accesses the numeric value of this port; this is valid for [`Num`] ports.
Expand Down

0 comments on commit 9a22ad5

Please sign in to comment.