Rust operators

From wikinotes
Revision as of 04:54, 11 February 2023 by Will (talk | contribs) (→‎${result}?)

Arithmetic

Result Operators

?

  • ok-val assign to `bar`
  • err-val return-early with Err(Err-val)
fn foo() -> Result<_, _> {
    let bar = get_result()?;
}

Operator Overloading