Skip to content

Commit a882d6b

Browse files
committed
[Rust] Fix workflow example after recent changes
1 parent 23bbec9 commit a882d6b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

rust/examples/workflow.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,17 @@ pub fn main() {
5252
binaryninja::headless::Session::new().expect("Failed to initialize session");
5353

5454
println!("Registering workflow...");
55-
let old_meta_workflow = Workflow::get("core.function.metaAnalysis");
55+
let old_meta_workflow =
56+
Workflow::get("core.function.metaAnalysis").expect("Couldn't find meta workflow");
5657
let meta_workflow = old_meta_workflow.clone_to("core.function.metaAnalysis");
5758
let activity = Activity::new_with_action(RUST_ACTIVITY_CONFIG, example_activity);
58-
meta_workflow.register_activity(&activity).unwrap();
59-
meta_workflow.insert("core.function.runFunctionRecognizers", [RUST_ACTIVITY_NAME]);
60-
// Re-register the meta workflow with our changes.
61-
meta_workflow.register().unwrap();
59+
meta_workflow
60+
.register_activity(&activity)
61+
.expect("Couldn't register activity")
62+
.insert("core.function.runFunctionRecognizers", [RUST_ACTIVITY_NAME])
63+
.expect("Couldn't insert activity")
64+
.register()
65+
.expect("Couldn't register workflow");
6266

6367
println!("Loading binary...");
6468
let bv = headless_session

0 commit comments

Comments
 (0)