openskill 0.0.1

Rust implementation of OpenSkill (license free TrueSkill)
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::{error::OpenSkillError, rating::Rating};

pub(crate) fn validate_team(teams: &Vec<Vec<Rating>>) -> Result<(), OpenSkillError> {
    if teams.iter().filter(|team| team.len() < 1).count() >= 1 {
        return Err(OpenSkillError::InvalidTeamCount(
            "team must contain atleast 1 player",
        ));
    }
    Ok(())
}