Skip to content

Commit

Permalink
docs: fix coption doc test (anza-xyz#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 <brooks@prumo.org>

* Update sdk/program/src/program_option.rs

Co-authored-by: Brooks <brooks@prumo.org>

---------

Co-authored-by: Brooks <brooks@prumo.org>
  • Loading branch information
2 people authored and ray-kast committed Nov 27, 2024
1 parent fb0b3e4 commit 11bf660
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 11bf660

Please sign in to comment.