Skip to content

Commit

Permalink
add reversed From<GateModifier> so enums dont drift
Browse files Browse the repository at this point in the history
  • Loading branch information
MarquessV committed Mar 25, 2024
1 parent 3294a3c commit 60a97f1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rust/src/instruction/gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ impl From<GateModifier> for quil_rs::instruction::GateModifier {
}
}
}

impl From<quil_rs::instruction::GateModifier> for GateModifier {
fn from(modifier: quil_rs::instruction::GateModifier) -> Self {
match modifier {
quil_rs::instruction::GateModifier::Controlled => GateModifier::Controlled,
quil_rs::instruction::GateModifier::Dagger => GateModifier::Dagger,
quil_rs::instruction::GateModifier::Forked => GateModifier::Forked,
}
}
}

0 comments on commit 60a97f1

Please sign in to comment.