Crate cairo_lang_utils

source
Expand description

Cairo utilities.

Modules§

Macros§

Traits§

Functions§

  • Borrows a mutable reference as Box for the lifespan of this function. Runs the given closure with the boxed value as a parameter. The closure is expected to return a boxed value, whose changes will be reflected on the mutable reference. Example:
  • Returns Some(()) if the condition is true, otherwise None. Useful in functions returning None on some condition: require(condition)?; And for functions returning Err on some condition: require(condition).ok_or_else(|| create_err())?;