Skip to content

Commit

Permalink
chore(viewport): replace match with unwrap_or_else
Browse files Browse the repository at this point in the history
  • Loading branch information
maximmaxim345 committed Jan 5, 2025
1 parent ddde33f commit 0196aa5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/viewport/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,14 @@ impl ViewportPipeline {
node_name: format!("node-{}", this.nodes.len()),
};

let handle: NodeHandle = match this.graph.add_node_dynamic(node.0, handle.node_name) {
Ok(node) => node,
Err(err) => match err {
let handle: NodeHandle = this
.graph
.add_node_dynamic(node.0, handle.node_name)
.unwrap_or_else(|err| match err {
computegraph::AddError::DuplicateName(_) => {
panic!("this should not happen")
}
},
};
});

match this.connect_plugin(handle.clone(), node.1) {
Ok(v) => Ok(v),
Expand Down

0 comments on commit 0196aa5

Please sign in to comment.