Skip to main content

require_non_empty

Function require_non_empty 

Source
pub fn require_non_empty<T, E>(
    items: Vec<T>,
    error: impl FnOnce() -> E,
) -> Result<Vec<T>, E>
Expand description

Returns items unchanged unless the list is empty, then calls error once. Does not inspect individual items: empty text can carry replay signatures. Request conversions that discard content must validate the converted list when their wire requires at least one block.