Skip to main content

is_ranking_permutation

Function is_ranking_permutation 

Source
pub fn is_ranking_permutation(order: &[usize], n: usize) -> bool
Expand description

Whether order is exactly the indices 0..n, each once — the RankingStrategy contract, as an assertion a strategy’s own tests can make.

rank_with repairs a violation rather than calling this, because a host mid-turn needs its evidence more than it needs a panic. That leaves a strategy author with nothing to fail on, which is what this is for.