async fn stations(&self) -> Stations {
        let mut all_stations: Vec<Station> = Vec::new();
        let services = self.services.clone();
        let services_len = services.len();
        for (i, service) in services.into_iter().enumerate() {
            let stations_mutex = service.stations().await;

            let stations = stations_mutex.lock().await;
            for mut station in stations.iter().map(|s| s.clone()) {
                if self.config.remap {
                    let channel = station.channel.as_ref().unwrap();
                    if let Ok(c) = channel.parse::<usize>() {
                        station.channel_remapped = Some((c + 100 * i).to_string());
                    } else if let Ok(c) = channel.parse::<f32>() {
                        station.channel_remapped = Some((c + 100.0 * i as f32).to_string());
                    } else {
                        panic!("Could not remap {}", channel);
                    };

                    // Convoluted.. let's fix this sometime..
                    let new_call_sign = station
                        .callSign
                        .replace(channel, &station.channel_remapped.as_ref().unwrap());
                    station.callSign_remapped = Some(new_call_sign);
                }
                self.station_id_service_map
                    .lock()
                    .await
                    .insert(station.id.to_string(), service.clone());
                all_stations.push(station);
            }
        }
        info!(
            "Got {} stations for {} cities",
            all_stations.len(),
            services_len
        );
        Arc::new(Mutex::new(all_stations))
    }
/// Get all stations for all `LocastService`s.
Get all stations for all `LocastService`s.
Get all stations for all ` LocastService ` s .
async fn stations(&self) -> Stations {
        let mut all_stations: Vec<Station> = Vec::new();
        let services = self.services.clone();
        let services_len = services.len();
        for (i, service) in services.into_iter().enumerate() {
            let stations_mutex = service.stations().await;
            let stations = stations_mutex.lock().await;
            for mut station in stations.iter().map(|s| s.clone()) {
                if self.config.remap {
                    let channel = station.channel.as_ref().unwrap();
                    if let Ok(c) = channel.parse::<usize>() {
                        station.channel_remapped = Some((c + 100 * i).to_string());
                    } else if let Ok(c) = channel.parse::<f32>() {
                        station.channel_remapped = Some((c + 100.0 * i as f32).to_string());
                    } else {
                        panic!("Could not remap {}", channel);
                    };
                    // Convoluted.. let's fix this sometime..
                    let new_call_sign = station
                        .callSign
                        .replace(channel, &station.channel_remapped.as_ref().unwrap());
                    station.callSign_remapped = Some(new_call_sign);
                }
                self.station_id_service_map
                    .lock()
                    .await
                    .insert(station.id.to_string(), service.clone());
                all_stations.push(station);
            }
        }
        info!(
            "Got {} stations for {} cities",
            all_stations.len(),
            services_len
        );
        Arc::new(Mutex::new(all_stations))
    }
async fn stations ( & self ) -> Stations { let mut all_stations : Vec < Station > = Vec :: new ( ) ; let services = self . services . clone ( ) ; let services_len = services . len ( ) ; for ( i , service ) in services . into_iter ( ) . enumerate ( ) { let stations_mutex = service . stations ( ) . await ; let stations = stations_mutex . lock ( ) . await ; for mut station in stations . iter ( ) . map ( | s | s . clone ( ) ) { if self . config . remap { let channel = station . channel . as_ref ( ) . unwrap ( ) ; if let Ok ( c ) = channel . parse :: < usize > ( ) { station . channel_remapped = Some ( ( c + 100 * i ) . to_string ( ) ) ; } else if let Ok ( c ) = channel . parse :: < f32 > ( ) { station . channel_remapped = Some ( ( c + 100.0 * i as f32 ) . to_string ( ) ) ; } else { panic ! ( " " channel ) ; } ; // Convoluted.. let's fix this sometime.. let new_call_sign = station . callSign . replace ( channel , & station . channel_remapped . as_ref ( ) . unwrap ( ) ) ; station . callSign_remapped = Some ( new_call_sign ) ; } self . station_id_service_map . lock ( ) . await . insert ( station . id . to_string ( ) , service . clone ( ) ) ; all_stations . push ( station ) ; } } info ! ( " " all_stations len ( ) services_len ) ; Arc :: new ( Mutex :: new ( all_stations ) ) }
Get all stations for all `LocastService`s.
Get all stations for all ` LocastService ` s .
&self