From 118ddc25547fc11d7cba98d429973cd6d5094bfa Mon Sep 17 00:00:00 2001 From: yihau Date: Tue, 13 Aug 2024 13:09:26 +0800 Subject: [PATCH 1/3] docs: fix coption doc test --- sdk/program/src/program_option.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/program/src/program_option.rs b/sdk/program/src/program_option.rs index b1a7c18d8a75a0..bbf537f25e5944 100644 --- a/sdk/program/src/program_option.rs +++ b/sdk/program/src/program_option.rs @@ -171,7 +171,8 @@ impl COption { /// assert_eq!(x.expect("the world is ending"), "value"); /// ``` /// - /// ```ignore{.should_panic} + /// ```should_panic + /// use solana_program::program_option::COption; /// let x: COption<&str> = COption::None; /// x.expect("the world is ending"); // panics with `the world is ending` /// ``` @@ -203,7 +204,8 @@ impl COption { /// assert_eq!(x.unwrap(), "air"); /// ``` /// - /// ```ignore{.should_panic} + /// ```should_panic + /// use solana_program::program_option::COption; /// let x: COption<&str> = COption::None; /// assert_eq!(x.unwrap(), "air"); // fails /// ``` From 7550303e82c850fa46e51b48185896f7dccb4020 Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Tue, 13 Aug 2024 22:23:15 +0800 Subject: [PATCH 2/3] Update sdk/program/src/program_option.rs Co-authored-by: Brooks --- sdk/program/src/program_option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/program/src/program_option.rs b/sdk/program/src/program_option.rs index bbf537f25e5944..04ed436201a9af 100644 --- a/sdk/program/src/program_option.rs +++ b/sdk/program/src/program_option.rs @@ -172,7 +172,7 @@ impl COption { /// ``` /// /// ```should_panic - /// use solana_program::program_option::COption; + /// # use solana_program::program_option::COption; /// let x: COption<&str> = COption::None; /// x.expect("the world is ending"); // panics with `the world is ending` /// ``` From e6b2644bba1b772f09932bf905ed6f646917c051 Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Tue, 13 Aug 2024 22:23:21 +0800 Subject: [PATCH 3/3] Update sdk/program/src/program_option.rs Co-authored-by: Brooks --- sdk/program/src/program_option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/program/src/program_option.rs b/sdk/program/src/program_option.rs index 04ed436201a9af..3496e5c282a804 100644 --- a/sdk/program/src/program_option.rs +++ b/sdk/program/src/program_option.rs @@ -205,7 +205,7 @@ impl COption { /// ``` /// /// ```should_panic - /// use solana_program::program_option::COption; + /// # use solana_program::program_option::COption; /// let x: COption<&str> = COption::None; /// assert_eq!(x.unwrap(), "air"); // fails /// ```