pub fn add(&mut self,preference:usize,who_for:T) -> anyhow::Result<()> {
        if preference==0 { return Err(anyhow!("Can't have a preference of 0"))}
        if self.received.len()<preference { self.received.resize(preference,None) }
        if self.received[preference-1].is_some() { return Err(anyhow!("Already got preference {}",preference))}
        self.received[preference-1] = Some(who_for);
        Ok(())
    }
// add a marking for `who_for` with preference `preference` starting from 1.
add a marking for `who_for` with preference `preference` starting from 1.
add a marking for ` who_for ` with preference ` preference ` starting from 1 .
pub fn add(&mut self,preference:usize,who_for:T) -> anyhow::Result<()> {
        if preference==0 { return Err(anyhow!("Can't have a preference of 0"))}
        if self.received.len()<preference { self.received.resize(preference,None) }
        if self.received[preference-1].is_some() { return Err(anyhow!("Already got preference {}",preference))}
        self.received[preference-1] = Some(who_for);
        Ok(())
    }
pub fn add ( & mut self , preference : usize , who_for : T ) -> anyhow :: Result < ( ) > { if preference == 0 { return Err ( anyhow ! ( " " ) ) } if self . received . len ( ) < preference { self . received . resize ( preference , None ) } if self . received [ preference - 1 ] . is_some ( ) { return Err ( anyhow ! ( " " preference ) ) } self . received [ preference - 1 ] = Some ( who_for ) ; Ok ( ( ) ) }
add a marking for `who_for` with preference `preference` starting from 1.
add a marking for ` who_for ` with preference ` preference ` starting from 1 .
&mut self
preference
usize
who_for
T
&mut self
preference
usize
who_for
T