summaryrefslogtreecommitdiff
path: root/rust/src/interaction.rs
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2024-04-17 12:35:04 -0300
committerKyle Martin <krm504@nyu.edu>2024-05-09 14:00:01 -0400
commitc528f3ad0e1abd4168b1507e8c30bc14c4a6a736 (patch)
tree83d13b9b64be9383929e755efa97fd4877b5f2ec /rust/src/interaction.rs
parent71a1c7e162046a44e7640e468b69a2b59599b198 (diff)
fix rust doc code
Diffstat (limited to 'rust/src/interaction.rs')
-rw-r--r--rust/src/interaction.rs22
1 files changed, 14 insertions, 8 deletions
diff --git a/rust/src/interaction.rs b/rust/src/interaction.rs
index 76fc9275..7d10bbe4 100644
--- a/rust/src/interaction.rs
+++ b/rust/src/interaction.rs
@@ -451,8 +451,10 @@ impl FormInputBuilder {
///
/// This API is flexible and works both in the UI via a pop-up dialog and on the command-line.
///
- /// ```
- /// let responses = interaction::FormInputBuilder::new()
+ /// ```no_run
+ /// # use binaryninja::interaction::FormInputBuilder;
+ /// # use binaryninja::interaction::FormResponses;
+ /// let responses = FormInputBuilder::new()
/// .text_field("First Name", None)
/// .text_field("Last Name", None)
/// .choice_field(
@@ -469,15 +471,19 @@ impl FormInputBuilder {
/// .get_form_input("Form Title");
///
/// let food = match responses[2] {
- /// Index(0) => "Pizza",
- /// Index(1) => "Also Pizza",
- /// Index(2) => "Also Pizza",
- /// Index(3) => "Wrong Answer",
+ /// FormResponses::Index(0) => "Pizza",
+ /// FormResponses::Index(1) => "Also Pizza",
+ /// FormResponses::Index(2) => "Also Pizza",
+ /// FormResponses::Index(3) => "Wrong Answer",
/// _ => panic!("This person doesn't like pizza?!?"),
/// };
///
- /// let interaction::FormResponses::String(last_name) = responses[0];
- /// let interaction::FormResponses::String(first_name) = responses[1];
+ /// let FormResponses::String(last_name) = &responses[0] else {
+ /// unreachable!()
+ /// };
+ /// let FormResponses::String(first_name) = &responses[1] else {
+ /// unreachable!()
+ /// };
///
/// println!("{} {} likes {}", &first_name, &last_name, food);
/// ```