fn base_port() -> u16 {
    let cwd = env::current_dir().unwrap();
    let dirs = ["32-opt", "32-nopt", "64-opt", "64-nopt", "64-opt-vg",
                "all-opt", "snap3", "dist"];
    dirs.iter().enumerate().find(|&(_, dir)| {
        cwd.to_str().unwrap().contains(dir)
    }).map(|p| p.0).unwrap_or(0) as u16 * 1000 + 19600
}
// The bots run multiple builds at the same time, and these builds
// all want to use ports. This function figures out which workspace
// it is running in and assigns a port range based on it.
The bots run multiple builds at the same time, and these builds
all want to use ports. This function figures out which workspace
it is running in and assigns a port range based on it.
The bots run multiple builds at the same time and these builds all want to use ports . This function figures out which workspace it is running in and assigns a port range based on it .
fn base_port() -> u16 {
    let cwd = env::current_dir().unwrap();
    let dirs = ["32-opt", "32-nopt", "64-opt", "64-nopt", "64-opt-vg",
                "all-opt", "snap3", "dist"];
    dirs.iter().enumerate().find(|&(_, dir)| {
        cwd.to_str().unwrap().contains(dir)
    }).map(|p| p.0).unwrap_or(0) as u16 * 1000 + 19600
}
fn base_port ( ) -> u16 { let cwd = env :: current_dir ( ) . unwrap ( ) ; let dirs = [ " " , " " , " " , " " , " " , " " , " " , " " ] ; dirs . iter ( ) . enumerate ( ) . find ( | & ( _ , dir ) | { cwd . to_str ( ) . unwrap ( ) . contains ( dir ) } ) . map ( | p | p . 0 ) . unwrap_or ( 0 ) as u16 * 1000 + 19600 }
The bots run multiple builds at the same time, and these builds
all want to use ports.
The bots run multiple builds at the same time and these builds all want to use ports .