1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use super::dependencies::*;


/// Methods collection for generating data related to transports
pub struct Transport;

impl Transport {
    /// Get a random car manufacturer
    pub fn manufacturer() -> &'static str {
        get_random_element(MANUFACTURERS.iter())
    }

    /// Get a random vehicle
    pub fn car() -> &'static str {
        get_random_element(CARS.iter())
    }

    /// Generate a dummy airplane model
    pub fn airplane() -> &'static str {
        get_random_element(AIRPLANES.iter())
    }

    /// Get vehicle registration code of country
    /// 
    /// # Arguments:
    /// * `locale` - Registration code for locale (country)
    pub fn vehicle_registration_code(locale: Option<Locale>) -> &'static str {
        match locale {
            Some(locale) => &VRC_BY_LOCALES.get(locale.get_data().lang_code.as_str()).unwrap(),
            None => get_random_element(VR_CODES.iter())
        }
    }
}