Skip to content

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cairolover committed Dec 26, 2024
1 parent 85008e0 commit 9b67600
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion corelib/src/result.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,21 @@
//! [`Ok`]: Result::Ok
//! [`Err`]: Result::Err
//!
//! ## Iterating over `Result`
//!
//! A [`Result`] can be iterated over. This can be helpful if you need an
//! iterator that is conditionally empty. The iterator will either produce
//! a single value (when the [`Result`] is [`Ok`]), or produce no values
//! (when the [`Result`] is [`Err`]). For example, [`into_iter`]
//! contains [`Some(v)`] if the [`Result`] is [`Ok(v)`], and [`None`] if the
//! [`Result`] is [`Err`].
//!
//! [`into_iter`]: IntoIterator::into_iter

#[allow(unused_imports)]
use crate::array::{ArrayTrait, SpanTrait};
#[allow(unused_imports)]
use crate::serde::Serde;
#[allow(unused_imports)]
use crate::iter::{IntoIterator, Iterator};

/// The type used for returning and propagating errors. It is an enum with the variants `Ok: T`,
Expand Down

0 comments on commit 9b67600

Please sign in to comment.