Skip to content

Commit

Permalink
docs: fix coption doc test (solana-labs#2571)
Browse files Browse the repository at this point in the history
* docs: fix coption doc test

* Update sdk/program/src/program_option.rs

Co-authored-by: Brooks <[email protected]>

* Update sdk/program/src/program_option.rs

Co-authored-by: Brooks <[email protected]>

---------

Co-authored-by: Brooks <[email protected]>
  • Loading branch information
yihau and brooksprumo authored Aug 13, 2024
1 parent fc208a0 commit 26f9bfc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/program/src/program_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ impl<T> COption<T> {
/// 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`
/// ```
Expand Down Expand Up @@ -203,7 +204,8 @@ impl<T> COption<T> {
/// 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
/// ```
Expand Down

0 comments on commit 26f9bfc

Please sign in to comment.