Skip to content

Commit

Permalink
for exposing operation name todo in circuit/command.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cobord committed Mar 14, 2024
1 parent 5e3030e commit 55b5405
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tket2/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ pub enum Tk2Op {
Reset,
}

impl Tk2Op {
#[allow(dead_code)]
fn exposed_name(&self) -> smol_str::SmolStr {
<Tk2Op as Into<OpType>>::into(*self).name()
}
}

/// Whether an op is a given Tk2Op.
pub fn op_matches(op: &OpType, tk2op: Tk2Op) -> bool {
op.name() == <Tk2Op as Into<OpType>>::into(tk2op).name()
Expand Down

0 comments on commit 55b5405

Please sign in to comment.