Skip to main content

get_or

Function get_or 

Source
pub fn get_or<S: Slot<Vec<T>>, T: Clone>(
    vec: &S,
    index: &Nat,
    fallback: impl Borrow<T>,
) -> T
Expand description

The element at index, or fallback, which is copied only if it is the answer.