Skip to content

Commit

Permalink
Remove unnecessary conversion name.to_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapeyre committed May 2, 2024
1 parent fbca320 commit f7cf821
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/qasm3/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,11 @@ impl BuilderState {
// Gates mapped via CustomGates will not raise an exception.
fn map_gate_ids(&mut self, _py: Python, ast_symbols: &SymbolTable) -> PyResult<()> {
for (name, name_id, defined_num_params, defined_num_qubits) in ast_symbols.gates().iter() {
let name = name.to_string();
if name == "U" {
if *name == "U" {
// The sole built in gate. `gphase` is treated specially.
continue;
}
let pygate = self.pygates.get(&name).ok_or_else(|| {
let pygate = self.pygates.get(*name).ok_or_else(|| {
QASM3ImporterError::new_err(format!("can't handle non-built-in gate: '{}'", name))
})?;
if pygate.num_params() != *defined_num_params {
Expand Down

0 comments on commit f7cf821

Please sign in to comment.