fn generate_new_experiment_name(db: &Database, issue: &Issue) -> Result<String> {
    let mut name = format!("pr-{}", issue.number);
    let mut idx = 1u16;
    while Experiment::exists(&db, &name)? {
        name = format!("pr-{}-{}", issue.number, idx);
        idx = idx
            .checked_add(1)
            .ok_or_else::<Error, _>(|| "too many similarly-named pull requests".into())?;
    }
    Ok(name)
}
/// Automatically generate experiment name, auto-incrementing to the first one which does not
/// exist.  E.g. if this function is passed the an issue `12345`, and experiment `pr-12345`
/// exists, then this command returns Ok("pr-12345-1"). Does not store the result in the database.
Automatically generate experiment name, auto-incrementing to the first one which does not
exist.
Automatically generate experiment name auto - incrementing to the first one which does not exist .
fn generate_new_experiment_name(db: &Database, issue: &Issue) -> Result<String> {
    let mut name = format!("pr-{}", issue.number);
    let mut idx = 1u16;
    while Experiment::exists(&db, &name)? {
        name = format!("pr-{}-{}", issue.number, idx);
        idx = idx
            .checked_add(1)
            .ok_or_else::<Error, _>(|| "too many similarly-named pull requests".into())?;
    }
    Ok(name)
}
fn generate_new_experiment_name ( db : & Database , issue : & Issue ) -> Result < String > { let mut name = format ! ( " " issue number ) ; let mut idx = 1u16 ; while Experiment :: exists ( & db , & name ) ? { name = format ! ( " " issue number idx ) ; idx = idx . checked_add ( 1 ) . ok_or_else :: < Error , _ > ( | | " " . into ( ) ) ? ; } Ok ( name ) }
Automatically generate experiment name, auto-incrementing to the first one which does not
exist.
Automatically generate experiment name auto - incrementing to the first one which does not exist .
db
&Database
issue
&Issue