Skip to content

Commit 0196aa5

Browse files
committed
chore(viewport): replace match with unwrap_or_else
1 parent ddde33f commit 0196aa5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/viewport/src/pipeline.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,14 @@ impl ViewportPipeline {
339339
node_name: format!("node-{}", this.nodes.len()),
340340
};
341341

342-
let handle: NodeHandle = match this.graph.add_node_dynamic(node.0, handle.node_name) {
343-
Ok(node) => node,
344-
Err(err) => match err {
342+
let handle: NodeHandle = this
343+
.graph
344+
.add_node_dynamic(node.0, handle.node_name)
345+
.unwrap_or_else(|err| match err {
345346
computegraph::AddError::DuplicateName(_) => {
346347
panic!("this should not happen")
347348
}
348-
},
349-
};
349+
});
350350

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

0 commit comments

Comments
 (0)