pub fn winner(&self, _ctx: &Context) -> Result<u32> {
        if self.accepting_votes {
            return Err("Voting is not closed.".to_string());
        }
        Ok(self
            .tally
            .iter()
            .enumerate()
            .max_by_key(|(_i, v)| *v)
            .unwrap()
            .0 as u32)
    }
/// Returns the index of the candidate with the most votes.
/// This method can only be called after voting has closed.

Returns the index of the candidate with the most votes.
This method can only be called after voting has closed.
Returns the index of the candidate with the most votes . This method can only be called after voting has closed .
pub fn winner(&self, _ctx: &Context) -> Result<u32> {
        if self.accepting_votes {
            return Err("Voting is not closed.".to_string());
        }
        Ok(self
            .tally
            .iter()
            .enumerate()
            .max_by_key(|(_i, v)| *v)
            .unwrap()
            .0 as u32)
    }
pub fn winner ( & self , _ctx : & Context ) -> Result < u32 > { if self . accepting_votes { return Err ( " " . to_string ( ) ) ; } Ok ( self . tally . iter ( ) . enumerate ( ) . max_by_key ( | ( _i , v ) | * v ) . unwrap ( ) . 0 as u32 ) }
Returns the index of the candidate with the most votes.
Returns the index of the candidate with the most votes .
&self
_ctx
&Context