Skip to content

Commit 5b9d5d2

Browse files
committed
[Rust] Add Workflow::cloned associated function
This simplifies the very common pattern of retrieving a workflow then cloning it in order to register activities.
1 parent e4b2f41 commit 5b9d5d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rust/src/workflow.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ impl Workflow {
280280
unsafe { Workflow::ref_from_raw(NonNull::new(result).unwrap()) }
281281
}
282282

283+
pub fn cloned(name: &str) -> Ref<Workflow> {
284+
Self::instance(name).clone_to(name)
285+
}
286+
283287
/// List of all registered [Workflow]'s
284288
pub fn list() -> Array<Workflow> {
285289
let mut count = 0;

0 commit comments

Comments
 (0)